|
1 | | -plugins { |
2 | | - signing |
3 | | - kotlin("jvm") apply false |
4 | | - alias(libs.plugins.com.vanniktech.maven.publish) apply false |
5 | | -} |
6 | | - |
7 | | -subprojects { |
8 | | - plugins.withType<JavaPlugin> { |
9 | | - |
10 | | - configure<JavaPluginExtension> { |
11 | | - withSourcesJar() |
12 | | - // We don't publish Javadoc, because it is useless in out case. We publish sources, plus it is easy to find |
13 | | - // GitHub project and read the source code. We don't have any comprehensive documentation, so let's just publish nothing. |
14 | | - // Additionally, JavaDoc task conflicts with publishing plugin, so let's simply delete one of them. |
15 | | - // withJavadocJar() |
16 | | - } |
17 | | - |
18 | | - tasks.withType<Test> { |
19 | | - useJUnitPlatform() |
20 | | - // store all temporary results inside the Gradle folder |
21 | | - val localTempFolder = layout.buildDirectory.dir("tmp").get().asFile |
22 | | - systemProperty("java.io.tmpdir", localTempFolder.absolutePath) |
23 | | - |
24 | | - doFirst { |
25 | | - // create the folder if needed |
26 | | - localTempFolder.mkdirs() |
27 | | - } |
28 | | - } |
29 | | - |
30 | | - plugins.withType<MavenPublishPlugin> { |
31 | | - plugins.apply(com.vanniktech.maven.publish.MavenPublishPlugin::class) |
32 | | - } |
33 | | - } |
34 | | - |
35 | | - |
36 | | - plugins.withType<MavenPublishPlugin> { |
37 | | - val publishing = the<PublishingExtension>() |
38 | | - |
39 | | - publishing.publications.withType<MavenPublication> { |
40 | | - pom { |
41 | | - val githubRepo = providers.gradleProperty("githubRepo") |
42 | | - val githubUrl = githubRepo.map { "https://github.com/$it" } |
43 | | - |
44 | | - name.set(providers.gradleProperty("projectName")) |
45 | | - description.set(providers.gradleProperty("projectDescription")) |
46 | | - url.set(providers.gradleProperty("projectUrl")) |
47 | | - licenses { |
48 | | - license { |
49 | | - name.set(providers.gradleProperty("projectLicenseName")) |
50 | | - url.set(providers.gradleProperty("projectLicenseUrl")) |
51 | | - } |
52 | | - } |
53 | | - developers { |
54 | | - developer { |
55 | | - name.set(providers.gradleProperty("developerName")) |
56 | | - email.set(providers.gradleProperty("developerEmail")) |
57 | | - url.set(providers.gradleProperty("developerUrl")) |
58 | | - } |
59 | | - } |
60 | | - scm { |
61 | | - url.set(githubUrl.map { "$it/tree/master" }) |
62 | | - connection.set(githubRepo.map { "scm:git:git://github.com/$it.git" }) |
63 | | - developerConnection.set(githubRepo.map { "scm:git:ssh://github.com:$it.git" }) |
64 | | - } |
65 | | - issueManagement { |
66 | | - url.set(githubUrl.map { "$it/issues" }) |
67 | | - system.set("GitHub") |
68 | | - } |
69 | | - } |
70 | | - } |
71 | | - |
72 | | - publishing.repositories { |
73 | | - maven { |
74 | | - name = "local" |
75 | | - url = file(layout.buildDirectory.dir("repos/releases")).toURI() |
76 | | - } |
77 | | - } |
78 | | - } |
79 | | -} |
80 | | - |
0 commit comments