|
1 |
| -buildscript { |
2 |
| - repositories { |
3 |
| - jcenter() |
4 |
| - dependencies { |
5 |
| - classpath 'com.github.ben-manes:gradle-versions-plugin:0.39.0' |
6 |
| - } |
7 |
| - } |
8 |
| -} |
9 |
| - |
10 | 1 | plugins {
|
11 | 2 | id 'signing'
|
12 |
| - id('io.github.gradle-nexus.publish-plugin') version '1.0.0' |
| 3 | + id('io.github.gradle-nexus.publish-plugin') version '1.1.0' |
13 | 4 | }
|
14 | 5 |
|
15 |
| -apply plugin: 'idea' |
16 |
| -apply plugin: 'scala' |
17 |
| -apply plugin: 'java-library' |
18 |
| -apply plugin: 'maven-publish' |
19 |
| -apply plugin: 'com.github.ben-manes.versions' |
20 |
| - |
21 |
| -sourceCompatibility = JavaVersion.VERSION_1_8 |
| 6 | +allprojects { |
| 7 | + group 'com.avast.hashes' |
| 8 | + version = version == 'unspecified' ? 'DEVELOPER-SNAPSHOT' : version |
| 9 | +} |
22 | 10 |
|
23 | 11 | ext {
|
24 | 12 | circeVersion = '0.13.0'
|
25 | 13 | }
|
26 | 14 |
|
27 |
| -group = 'com.avast.hashes' |
28 |
| -archivesBaseName = "scala-hashes_$scalaVersion" |
29 |
| - |
30 |
| -repositories { |
31 |
| - mavenCentral() |
| 15 | +nexusPublishing { |
| 16 | + repositories { |
| 17 | + sonatype() |
| 18 | + } |
32 | 19 | }
|
33 | 20 |
|
34 |
| -dependencies { |
35 |
| - api "org.scala-lang:scala-library:${scalaLibraryVersion}" |
36 |
| - compileOnly "org.json4s:json4s-core_${scalaVersion}:3.6.9" |
37 |
| - compileOnly "io.circe:circe-core_${scalaVersion}:${circeVersion}" |
| 21 | +subprojects { |
| 22 | + apply plugin: 'scala' |
| 23 | + apply plugin: 'java-library' |
| 24 | + apply plugin: 'maven-publish' |
38 | 25 |
|
39 |
| - testImplementation "org.scalatest:scalatest_${scalaVersion}:3.2.0" |
40 |
| - testImplementation "org.scalatestplus:junit-4-12_${scalaVersion}:3.1.3.0" |
41 |
| - testImplementation "io.circe:circe-core_${scalaVersion}:${circeVersion}" |
42 |
| - testImplementation "junit:junit:4.13.2" |
43 |
| -} |
| 26 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
44 | 27 |
|
45 |
| -java { |
46 |
| - withJavadocJar() |
47 |
| - withSourcesJar() |
48 |
| -} |
| 28 | + repositories { |
| 29 | + mavenCentral() |
| 30 | + } |
49 | 31 |
|
50 |
| -publishing { |
51 |
| - publications { |
52 |
| - mavenJava(MavenPublication) { |
53 |
| - from(components.java) |
54 |
| - artifactId = archivesBaseName |
55 |
| - pom { |
56 |
| - name = 'Scala Hashes' |
57 |
| - description = 'Case-classes representing MD5, SHA1 and SHA256.' |
58 |
| - url = 'https://github.com/avast/scala-hashes' |
59 |
| - licenses { |
60 |
| - license { |
61 |
| - name = 'The MIT License' |
62 |
| - url = 'http://www.opensource.org/licenses/mit-license.php' |
63 |
| - } |
64 |
| - } |
65 |
| - developers { |
66 |
| - developer { |
67 |
| - id = 'augi' |
68 |
| - name = 'Michal Augustýn' |
69 |
| - |
| 32 | + dependencies { |
| 33 | + api "org.scala-lang:scala-library:${scalaLibraryVersion}" |
| 34 | + |
| 35 | + testImplementation "org.scalatest:scalatest_${scalaVersion}:3.2.0" |
| 36 | + testImplementation "org.scalatestplus:junit-4-12_${scalaVersion}:3.1.3.0" |
| 37 | + testImplementation "junit:junit:4.13.2" |
| 38 | + } |
| 39 | + |
| 40 | + java { |
| 41 | + withJavadocJar() |
| 42 | + withSourcesJar() |
| 43 | + } |
| 44 | + |
| 45 | + afterEvaluate { |
| 46 | + |
| 47 | + publishing { |
| 48 | + publications { |
| 49 | + mavenJava(MavenPublication) { |
| 50 | + from(components.java) |
| 51 | + artifactId = archivesBaseName |
| 52 | + pom { |
| 53 | + name = 'Scala Hashes' |
| 54 | + description = 'Case-classes representing MD5, SHA1 and SHA256.' |
| 55 | + url = 'https://github.com/avast/scala-hashes' |
| 56 | + licenses { |
| 57 | + license { |
| 58 | + name = 'The MIT License' |
| 59 | + url = 'http://www.opensource.org/licenses/mit-license.php' |
| 60 | + } |
| 61 | + } |
| 62 | + developers { |
| 63 | + developer { |
| 64 | + id = 'augi' |
| 65 | + name = 'Michal Augustýn' |
| 66 | + |
| 67 | + } |
| 68 | + } |
| 69 | + scm { |
| 70 | + connection = 'scm:git:git://github.com/avast/scala-hashes.git' |
| 71 | + developerConnection = 'scm:git:ssh://github.com/avast/scala-hashes.git' |
| 72 | + url = 'https://github.com/avast/scala-hashes' |
| 73 | + } |
70 | 74 | }
|
71 | 75 | }
|
72 |
| - scm { |
73 |
| - connection = 'scm:git:git://github.com/avast/scala-hashes.git' |
74 |
| - developerConnection = 'scm:git:ssh://github.com/avast/scala-hashes.git' |
75 |
| - url = 'https://github.com/avast/scala-hashes' |
76 |
| - } |
77 | 76 | }
|
78 | 77 | }
|
79 | 78 | }
|
80 |
| -} |
81 |
| - |
82 |
| -signing { |
83 |
| - String base64Key = System.getenv('SIGNING_KEY') |
84 |
| - if (base64Key) { |
85 |
| - useInMemoryPgpKeys(new String(Base64.decoder.decode(base64Key)), System.getenv('SIGNING_PASSWORD')) |
86 |
| - sign publishing.publications |
87 |
| - } |
88 |
| -} |
89 | 79 |
|
90 |
| -nexusPublishing { |
91 |
| - repositories { |
92 |
| - sonatype() |
| 80 | + signing { |
| 81 | + String base64Key = System.getenv('SIGNING_KEY') |
| 82 | + if (base64Key) { |
| 83 | + useInMemoryPgpKeys(new String(Base64.decoder.decode(base64Key)), System.getenv('SIGNING_PASSWORD')) |
| 84 | + sign publishing.publications |
| 85 | + } |
93 | 86 | }
|
94 | 87 | }
|
0 commit comments