Skip to content

Commit 87a0fe1

Browse files
committed
System: migrate to Maven Central
1 parent 4e8c0f4 commit 87a0fe1

File tree

8 files changed

+145
-77
lines changed

8 files changed

+145
-77
lines changed

bintray-publish.gradle

Lines changed: 0 additions & 61 deletions
This file was deleted.

build.gradle

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ buildscript {
33

44
repositories {
55
google()
6-
jcenter()
7-
mavenLocal()
8-
maven { url "https://dl.bintray.com/readdle/maven" }
6+
mavenCentral()
7+
maven {
8+
url "https://plugins.gradle.org/m2/"
9+
}
910
}
1011

1112
dependencies {
12-
classpath "com.android.tools.build:gradle:3.6.0"
13-
classpath "com.readdle.android.swift:gradle:1.3.2"
13+
classpath 'com.android.tools.build:gradle:4.2.0'
14+
classpath "com.readdle.android.swift:gradle:1.3.5"
1415
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1516
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
16-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
17+
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
1718
}
1819
}
1920

@@ -23,11 +24,18 @@ subprojects { project ->
2324

2425
repositories {
2526
google()
26-
jcenter()
27-
maven { url "https://dl.bintray.com/readdle/maven" }
27+
mavenCentral()
2828
}
2929
}
3030

3131
task clean(type: Delete) {
3232
delete rootProject.buildDir
3333
}
34+
35+
apply plugin: 'io.github.gradle-nexus.publish-plugin'
36+
apply from: "${rootDir}/publish-root.gradle"
37+
38+
ext {
39+
PUBLISH_GROUP_ID = 'com.readdle.swift.java.codegen'
40+
PUBLISH_VERSION = "0.8.3"
41+
}

compiler/build.gradle

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
apply plugin: 'java'
1+
apply plugin: 'java-library'
2+
apply plugin: 'maven-publish'
23

34
archivesBaseName = "compiler"
45

56
dependencies {
6-
implementation project(':library')
7-
implementation 'com.google.code.gson:gson:2.8.5'
7+
api project(':library')
8+
api 'com.google.code.gson:gson:2.8.6'
89
}
910

10-
apply from: rootProject.file('bintray-publish.gradle')
11+
java {
12+
sourceCompatibility = JavaVersion.VERSION_1_8
13+
targetCompatibility = JavaVersion.VERSION_1_8
14+
15+
withSourcesJar()
16+
withJavadocJar()
17+
}
18+
19+
ext {
20+
PUBLISH_ARTIFACT_ID = 'compiler'
21+
}
22+
23+
apply from: "${rootProject.projectDir}/publish-module.gradle"

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

library/build.gradle

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
apply plugin: 'java'
1+
apply plugin: 'java-library'
2+
apply plugin: 'maven-publish'
23

34
archivesBaseName = "annotations"
45

5-
apply from: rootProject.file('bintray-publish.gradle')
6+
java {
7+
sourceCompatibility = JavaVersion.VERSION_1_8
8+
targetCompatibility = JavaVersion.VERSION_1_8
9+
10+
withSourcesJar()
11+
withJavadocJar()
12+
}
13+
14+
ext {
15+
PUBLISH_ARTIFACT_ID = 'annotations'
16+
}
17+
18+
apply from: "${rootProject.projectDir}/publish-module.gradle"

publish-module.gradle

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
3+
4+
group = PUBLISH_GROUP_ID
5+
version = PUBLISH_VERSION
6+
7+
afterEvaluate {
8+
publishing {
9+
publications {
10+
release(MavenPublication) {
11+
from components.java
12+
13+
groupId PUBLISH_GROUP_ID
14+
artifactId PUBLISH_ARTIFACT_ID
15+
version PUBLISH_VERSION
16+
17+
pom {
18+
name = PUBLISH_ARTIFACT_ID
19+
description = 'Swift Java codegen'
20+
url = 'https://github.com/readdle/swift-java-codegen'
21+
licenses {
22+
license {
23+
name = 'MIT License'
24+
url = 'https://github.com/readdle/swift-java-codegen/blob/master/LICENSE'
25+
}
26+
}
27+
developers {
28+
developer {
29+
id = 'andriydruk'
30+
name = 'Andrew Druk'
31+
email = 'adruk@readdle.com'
32+
}
33+
}
34+
scm {
35+
connection = 'scm:git:github.com/readdle/swift-java-codegen.git'
36+
developerConnection = 'scm:git:ssh://github.com/readdle/swift-java-codegen.git'
37+
url = 'https://github.com/readdle/swift-java-codegen'
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}
44+
45+
ext["signing.keyId"] = rootProject.ext["signing.keyId"]
46+
ext["signing.password"] = rootProject.ext["signing.password"]
47+
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]
48+
49+
signing {
50+
sign publishing.publications
51+
}

publish-root.gradle

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Create variables with empty default values
2+
ext["signing.keyId"] = ''
3+
ext["signing.password"] = ''
4+
ext["signing.secretKeyRingFile"] = ''
5+
ext["ossrhUsername"] = ''
6+
ext["ossrhPassword"] = ''
7+
ext["sonatypeStagingProfileId"] = ''
8+
9+
File secretPropsFile = project.rootProject.file('local.properties')
10+
if (secretPropsFile.exists()) {
11+
// Read local.properties file first if it exists
12+
Properties p = new Properties()
13+
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
14+
p.each { name, value -> ext[name] = value }
15+
} else {
16+
// Use system environment variables
17+
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
18+
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
19+
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
20+
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
21+
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
22+
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
23+
}
24+
25+
// Set up Sonatype repository
26+
nexusPublishing {
27+
repositories {
28+
sonatype {
29+
stagingProfileId = sonatypeStagingProfileId
30+
username = ossrhUsername
31+
password = ossrhPassword
32+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
33+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
34+
}
35+
}
36+
}

sample/build.gradle

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ swift {
1010
useKapt true
1111
cleanEnabled true
1212
debug {
13-
abiFilters("arm64-v8a")
1413
extraBuildFlags("-Xswiftc", "-DDEBUG")
1514
}
1615
}
@@ -41,8 +40,17 @@ android {
4140
buildTypes {
4241
release {
4342
minifyEnabled false
43+
debuggable false
44+
jniDebuggable false
4445
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
4546
}
47+
debug {
48+
debuggable true
49+
jniDebuggable true
50+
ndk {
51+
abiFilters = ["arm64-v8a", "x86_64"]
52+
}
53+
}
4654
}
4755
}
4856

0 commit comments

Comments
 (0)