Skip to content

Commit 7adcb77

Browse files
committed
Move publishing code to included file
1 parent 7aa18fa commit 7adcb77

8 files changed

Lines changed: 86 additions & 400 deletions

File tree

api/build.gradle

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,7 @@ android {
2323
}
2424
}
2525

26-
apply from: "../gradle/androidJars.gradle"
26+
apply from: '../gradle/androidJars.gradle'
27+
apply from: '../gradle/publish.gradle'
2728

28-
afterEvaluate {
29-
publishing {
30-
publications {
31-
release(MavenPublication) {
32-
pom {
33-
name = 'UnifiedNlp API'
34-
description = 'API interfaces and helpers to create backends for UnifiedNlp'
35-
url = 'https://github.com/microg/UnifiedNlp'
36-
licenses {
37-
license {
38-
name = 'The Apache Software License, Version 2.0'
39-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
40-
}
41-
}
42-
developers {
43-
developer {
44-
id = 'microg'
45-
name = 'microG Team'
46-
}
47-
developer {
48-
id = 'mar-v-in'
49-
name = 'Marvin W.'
50-
}
51-
}
52-
scm {
53-
url = 'https://github.com/microg/UnifiedNlp'
54-
connection = 'scm:git:https://github.com/microg/UnifiedNlp.git'
55-
developerConnection = 'scm:git:ssh://github.com/microg/UnifiedNlp.git'
56-
}
57-
}
58-
59-
from components.release
60-
artifact androidSourcesJar
61-
artifact androidJavadocsJar
62-
}
63-
}
64-
if (project.hasProperty('sonatype.username')) {
65-
repositories {
66-
maven {
67-
name = 'sonatype'
68-
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
69-
credentials {
70-
username project.getProperty('sonatype.username')
71-
password project.getProperty('sonatype.password')
72-
}
73-
}
74-
}
75-
}
76-
}
77-
if (project.hasProperty('signing.keyId')) {
78-
signing {
79-
sign publishing.publications
80-
}
81-
}
82-
}
29+
description = 'API interfaces and helpers to create backends for UnifiedNlp'

client/build.gradle

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -29,66 +29,12 @@ android {
2929
}
3030
}
3131

32-
apply from: "../gradle/androidJars.gradle"
32+
apply from: '../gradle/androidJars.gradle'
33+
apply from: '../gradle/publish.gradle'
34+
35+
description = 'UnifiedNlp client library'
3336

3437
dependencies {
3538
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
3639
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion"
3740
}
38-
39-
afterEvaluate {
40-
publishing {
41-
publications {
42-
release(MavenPublication) {
43-
pom {
44-
name = 'UnifiedNlp Client'
45-
description = 'UnifiedNlp client library'
46-
url = 'https://github.com/microg/UnifiedNlp'
47-
licenses {
48-
license {
49-
name = 'The Apache Software License, Version 2.0'
50-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
51-
}
52-
}
53-
developers {
54-
developer {
55-
id = 'microg'
56-
name = 'microG Team'
57-
}
58-
developer {
59-
id = 'mar-v-in'
60-
name = 'Marvin W.'
61-
}
62-
}
63-
scm {
64-
url = 'https://github.com/microg/UnifiedNlp'
65-
connection = 'scm:git:https://github.com/microg/UnifiedNlp.git'
66-
developerConnection = 'scm:git:ssh://github.com/microg/UnifiedNlp.git'
67-
}
68-
}
69-
70-
from components.release
71-
artifact androidSourcesJar
72-
artifact androidJavadocsJar
73-
}
74-
}
75-
if (project.hasProperty('sonatype.username')) {
76-
repositories {
77-
maven {
78-
name = 'sonatype'
79-
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
80-
credentials {
81-
username project.getProperty('sonatype.username')
82-
password project.getProperty('sonatype.password')
83-
}
84-
}
85-
}
86-
}
87-
}
88-
if (project.hasProperty('signing.keyId')) {
89-
signing {
90-
sign publishing.publications
91-
}
92-
}
93-
94-
}

geocode-v1/build.gradle

Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -23,65 +23,12 @@ android {
2323
}
2424
}
2525

26-
apply from: "../gradle/androidJars.gradle"
26+
apply from: '../gradle/androidJars.gradle'
27+
apply from: '../gradle/publish.gradle'
28+
29+
description = 'UnifiedNlp service to implement Geocode API v1'
2730

2831
dependencies {
2932
implementation project(':client')
3033
compileOnly project(':compat')
3134
}
32-
33-
afterEvaluate {
34-
publishing {
35-
publications {
36-
release(MavenPublication) {
37-
pom {
38-
name = 'UnifiedNlp Geocode v1'
39-
description = 'UnifiedNlp service to implement Geocode API v1'
40-
url = 'https://github.com/microg/UnifiedNlp'
41-
licenses {
42-
license {
43-
name = 'The Apache Software License, Version 2.0'
44-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
45-
}
46-
}
47-
developers {
48-
developer {
49-
id = 'microg'
50-
name = 'microG Team'
51-
}
52-
developer {
53-
id = 'mar-v-in'
54-
name = 'Marvin W.'
55-
}
56-
}
57-
scm {
58-
url = 'https://github.com/microg/UnifiedNlp'
59-
connection = 'scm:git:https://github.com/microg/UnifiedNlp.git'
60-
developerConnection = 'scm:git:ssh://github.com/microg/UnifiedNlp.git'
61-
}
62-
}
63-
64-
from components.release
65-
artifact androidSourcesJar
66-
artifact androidJavadocsJar
67-
}
68-
}
69-
if (project.hasProperty('sonatype.username')) {
70-
repositories {
71-
maven {
72-
name = 'sonatype'
73-
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
74-
credentials {
75-
username project.getProperty('sonatype.username')
76-
password project.getProperty('sonatype.password')
77-
}
78-
}
79-
}
80-
}
81-
}
82-
if (project.hasProperty('signing.keyId')) {
83-
signing {
84-
sign publishing.publications
85-
}
86-
}
87-
}

gradle/publish.gradle

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2020, microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
afterEvaluate {
7+
publishing {
8+
publications {
9+
release(MavenPublication) {
10+
pom {
11+
name = project.name
12+
url = 'https://github.com/microg/UnifiedNlp'
13+
licenses {
14+
license {
15+
name = 'The Apache Software License, Version 2.0'
16+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
17+
}
18+
}
19+
developers {
20+
developer {
21+
id = 'microg'
22+
name = 'microG Team'
23+
}
24+
developer {
25+
id = 'mar-v-in'
26+
name = 'Marvin W.'
27+
}
28+
}
29+
scm {
30+
url = 'https://github.com/microg/UnifiedNlp'
31+
connection = 'scm:git:https://github.com/microg/UnifiedNlp.git'
32+
developerConnection = 'scm:git:ssh://github.com/microg/UnifiedNlp.git'
33+
}
34+
}
35+
36+
from components.release
37+
artifact androidSourcesJar
38+
artifact androidJavadocsJar
39+
}
40+
}
41+
if (project.hasProperty('sonatype.username')) {
42+
repositories {
43+
maven {
44+
name = 'sonatype'
45+
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
46+
credentials {
47+
username project.getProperty('sonatype.username')
48+
password project.getProperty('sonatype.password')
49+
}
50+
}
51+
}
52+
}
53+
}
54+
if (project.hasProperty('signing.keyId')) {
55+
signing {
56+
sign publishing.publications
57+
}
58+
}
59+
}

location-v2/build.gradle

Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -23,65 +23,12 @@ android {
2323
}
2424
}
2525

26-
apply from: "../gradle/androidJars.gradle"
26+
apply from: '../gradle/androidJars.gradle'
27+
apply from: '../gradle/publish.gradle'
28+
29+
description = 'UnifiedNlp service to implement Location API v2'
2730

2831
dependencies {
2932
implementation project(':client')
3033
compileOnly project(':compat')
3134
}
32-
33-
afterEvaluate {
34-
publishing {
35-
publications {
36-
release(MavenPublication) {
37-
pom {
38-
name = 'UnifiedNlp Location v2'
39-
description = 'UnifiedNlp service to implement Location API v2'
40-
url = 'https://github.com/microg/UnifiedNlp'
41-
licenses {
42-
license {
43-
name = 'The Apache Software License, Version 2.0'
44-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
45-
}
46-
}
47-
developers {
48-
developer {
49-
id = 'microg'
50-
name = 'microG Team'
51-
}
52-
developer {
53-
id = 'mar-v-in'
54-
name = 'Marvin W.'
55-
}
56-
}
57-
scm {
58-
url = 'https://github.com/microg/UnifiedNlp'
59-
connection = 'scm:git:https://github.com/microg/UnifiedNlp.git'
60-
developerConnection = 'scm:git:ssh://github.com/microg/UnifiedNlp.git'
61-
}
62-
}
63-
64-
from components.release
65-
artifact androidSourcesJar
66-
artifact androidJavadocsJar
67-
}
68-
}
69-
if (project.hasProperty('sonatype.username')) {
70-
repositories {
71-
maven {
72-
name = 'sonatype'
73-
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
74-
credentials {
75-
username project.getProperty('sonatype.username')
76-
password project.getProperty('sonatype.password')
77-
}
78-
}
79-
}
80-
}
81-
}
82-
if (project.hasProperty('signing.keyId')) {
83-
signing {
84-
sign publishing.publications
85-
}
86-
}
87-
}

0 commit comments

Comments
 (0)