-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
122 lines (111 loc) · 3.84 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// :buildSrc
buildscript {
ext {
github_handle = "syslogic"
plugin_display_name = "AppGallery Connect Publishing Plugin"
plugin_description = "It uploads Android APK/ABB artifacts with AppGallery Connect Publishing API."
plugin_identifier = "agconnect-publishing-gradle-plugin"
plugin_class = "io.syslogic.agconnect.PublishingPlugin"
plugin_id = "io.syslogic.agconnect.publishing"
plugin_version = libs.versions.plugin.version.get()
}
}
plugins {
alias(libs.plugins.maven.publish)
alias(libs.plugins.gradle.plugin)
alias(libs.plugins.gradle.publish)
}
dependencies {
compileOnly gradleApi()
//noinspection DependencyNotationArgument
implementation libs.android.gradle
//noinspection DependencyNotationArgument
implementation libs.annotations
//noinspection DependencyNotationArgument
implementation libs.bundles.http.components
testImplementation libs.junit
//noinspection DependencyNotationArgument
testImplementation libs.annotations
testImplementation gradleTestKit()
testImplementation(project)
}
gradlePlugin {
plugins {
PublishingPlugin {
id = "${plugin_id}"
displayName = "${plugin_display_name}"
description = "${plugin_description}"
implementationClass = "${plugin_class}"
}
}
}
tasks.withType(Jar).configureEach {
archiveBaseName.set(plugin_identifier)
archiveVersion.set("${plugin_version}")
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
tasks.register("javadocs", Javadoc) {
title = "${plugin_display_name} ${plugin_version} API"
source = java.sourceSets.main.java.srcDirs
destinationDir = project.file("/build/outputs/javadoc")
classpath = files(new File(System.getProperty("java.home") + File.separator + "lib" + File.separator + "rt.jar"))
classpath += configurations.implementation
options.links "https://docs.oracle.com/en/java/javase/17/docs/api/"
options.linkSource true
options.author true
failOnError false
}
tasks.register("javadocJar", Jar) {
dependsOn javadoc
archiveClassifier.set("javadoc")
from javadoc.destinationDir
}
tasks.register("sourcesJar", Jar) {
from java.sourceSets.main.java.srcDirs
archiveClassifier.set("sources")
}
group = "io.syslogic"
version = "${plugin_version}"
artifacts {
archives javadocJar
archives sourcesJar
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId = group
artifactId = "${plugin_identifier}"
from components.getByName("java")
version = "${plugin_version}"
pom {
name = "${plugin_display_name}"
description = "${plugin_description}"
url = "https://github.com/${github_handle}/${plugin_identifier}"
scm {
connection = "scm:git:git://github.com/${github_handle}/${plugin_identifier}.git"
developerConnection = "scm:git:ssh://github.com/${github_handle}/${plugin_identifier}.git"
url = "https://github.com/${github_handle}/${plugin_identifier}/"
}
}
}
}
repositories {
/*
* JetBrains Spaces Repository (private)
* https://lp.jetbrains.com/space-source-code-management/
*/
if (System.getenv("JB_SPACE_MAVEN_REPO") != null) {
maven {
url = System.getenv("JB_SPACE_MAVEN_REPO")
credentials {
username = System.getenv("JB_SPACE_CLIENT_ID")
password = System.getenv("JB_SPACE_CLIENT_SECRET")
}
}
}
}
}
}