Skip to content

Commit

Permalink
bintray => sonatype/nexus/mavenCentral
Browse files Browse the repository at this point in the history
  • Loading branch information
Miha-x64 committed May 28, 2021
1 parent 333f475 commit 5e3b9b1
Show file tree
Hide file tree
Showing 25 changed files with 225 additions and 197 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ before_install:

script:
- ./gradlew clean :persistence:test :extended-persistence:test :properties:test :sql:test :http:test :fx-bindings:test :samples:fx-sample:test :android-json:test :android-bindings:test :samples:android-sample:test :samples:logic-sample:test
# - ./gradlew :persistence:bintrayUpload :extended-persistence:bintrayUpload :properties:bintrayUpload :sql:bintrayUpload :http:bintrayUpload :android-json:bintrayUpload :android-json-on-jvm:bintrayUpload :android-bindings:bintrayUpload

#after_success:
# - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r properties/build/reports/jacoco/test/jacocoTestReport.xml
Expand Down
11 changes: 9 additions & 2 deletions android-bindings/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies {
implementation project(':properties') // subscriptions & reactivity
implementation project(':persistence') // saving/restoring state, tools for wrapping SharedPreferences, JSON, Parcel

testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
testImplementation "com.squareup.okio:okio:$okio_version"
testImplementation project(':etc:testing')
testImplementation project(':extended-persistence') // partial(Struct) is here
Expand All @@ -60,4 +60,11 @@ dependencies {
testImplementation project(':android-json-on-jvm')
}

apply from: rootProject.file('etc/release-bintray.gradle')
ext {
PUBLISH_GROUP_ID = 'su.lychee'
PUBLISH_ARTIFACT_ID = 'android-bindings'
PUBLISH_VERSION = '0.0.17'
PUBLISH_NAME = 'Android Bindings for Lychee'
PUBLISH_DESCRIPTION = 'Bindings between Lychee Properties and Android Views'
}
apply from: rootProject.file('etc/publish-module.gradle')
6 changes: 0 additions & 6 deletions android-bindings/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
POM_NAME=Android Bindings for Lychee
POM_DESCRIPTION=Android bindings for Lychee
POM_BINTRAY_NAME=net.aquadc.properties:android-bindings
POM_ARTIFACT_ID=android-bindings
POM_PACKAGING=jar
POM_VERSION=0.0.17
android.useAndroidX=true
11 changes: 9 additions & 2 deletions android-json-on-jvm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ plugins {
}

dependencies {
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.code.gson:gson:2.8.6'
}

apply from: rootProject.file('etc/release-bintray.gradle')
ext {
PUBLISH_GROUP_ID = 'su.lychee'
PUBLISH_ARTIFACT_ID = 'android-json-on-jvm'
PUBLISH_VERSION = '0.0.17'
PUBLISH_NAME = 'android.util.JsonReader/Writer on JVM'
PUBLISH_DESCRIPTION = 'android.util.JsonReader/JsonWriter implementation for JVM'
}
apply from: rootProject.file('etc/publish-module.gradle')
6 changes: 0 additions & 6 deletions android-json-on-jvm/gradle.properties

This file was deleted.

9 changes: 8 additions & 1 deletion android-json/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ dependencies {
compileOnly "com.google.android:android:$android_artifact_version"
}

apply from: rootProject.file('etc/release-bintray.gradle')
ext {
PUBLISH_GROUP_ID = 'su.lychee'
PUBLISH_ARTIFACT_ID = 'android-json'
PUBLISH_VERSION = '0.0.17'
PUBLISH_NAME = 'Lychee Android JSON bindings'
PUBLISH_DESCRIPTION = 'android.util.JsonReader/JsonWriter bindings for Lychee persistence'
}
apply from: rootProject.file('etc/publish-module.gradle')
6 changes: 0 additions & 6 deletions android-json/gradle.properties

This file was deleted.

13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

buildscript {
ext.kotlin_version = '1.5.0'
ext.okio_version = '2.4.1'
Expand All @@ -13,27 +12,29 @@ buildscript {
mavenCentral()
google()
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

classpath 'com.android.tools.build:gradle:4.1.3'

classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.10.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.32'
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply from: "etc/publish-root.gradle"

allprojects {
repositories {
jcenter()
mavenCentral()
google()
// that's where KitKat Android.jar is stored:
maven { url 'https://philanthropist.touk.pl/nexus/content/repositories/releases/' }
// net.aquadc.collections:Collection-utils are here:
// net.aquadc.collections:Collection-utils are here. There's also com.github.grishka's LiteX in Android sample
maven { url 'https://jitpack.io' }
}

Expand Down
1 change: 1 addition & 0 deletions etc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
key/
84 changes: 0 additions & 84 deletions etc/bintray.gradle

This file was deleted.

102 changes: 102 additions & 0 deletions etc/publish-module.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

if (project.hasProperty("android")) { // Android libraries
task sourcesJar(type: Jar) {
archiveClassifier.set 'sources'
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

apply plugin: "org.jetbrains.dokka"
tasks.dokkaJavadoc.configure {
outputDirectory.set(file("$buildDir/javadoc"))
}

task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
archiveClassifier.set 'javadoc'
from "$buildDir/javadoc"
}
} else { // Java libraries
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set 'sources'
from sourceSets.main.allSource
}

apply plugin: "org.jetbrains.dokka"
tasks.dokkaJavadoc.configure {
outputDirectory.set(file("$buildDir/javadoc"))
}

task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
archiveClassifier.set 'javadoc'
from "$buildDir/javadoc"
}
}

artifacts {
archives javadocJar
archives sourcesJar
}

group = PUBLISH_GROUP_ID
version = PUBLISH_VERSION

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId PUBLISH_GROUP_ID
artifactId PUBLISH_ARTIFACT_ID
version PUBLISH_VERSION

// Two artifacts, the `aar` (or `jar`) and the sources
if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
from components.java
}

artifact sourcesJar
artifact javadocJar

pom {
name = PUBLISH_NAME
description = PUBLISH_DESCRIPTION
url = 'https://github.com/Miha-x64/Lychee'
licenses {
license {
name = 'Apache-2.0'
url = 'https://github.com/Miha-x64/Lychee/blob/master/LICENSE'
}
}
developers {
developer {
id = 'Miha-x64'
name = 'Mike'
email = 'silizium@ok.de'
}
}

scm {
connection = 'scm:git:github.com/Miha-x64/Lychee.git'
developerConnection = 'scm:git:ssh://github.com/Miha-x64/Lychee.git'
url = 'https://github.com/Miha-x64/Lychee/tree/master'
}
}
}
}
}
}

ext["signing.keyId"] = rootProject.ext["signing.keyId"]
ext["signing.password"] = rootProject.ext["signing.password"]
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]

signing {
sign publishing.publications
}
34 changes: 34 additions & 0 deletions etc/publish-root.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ext["signing.keyId"] = ''
ext["signing.password"] = ''
ext["signing.secretKeyRingFile"] = ''
ext["ossrhUsername"] = ''
ext["ossrhPassword"] = ''
ext["sonatypeStagingProfileId"] = ''

File secretPropsFile = project.rootProject.file('local.properties')
if (secretPropsFile.exists()) {
// Read local.properties file first if it exists
Properties p = new Properties()
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
p.each { name, value -> ext[name] = value }
} else {
// Use system environment variables
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
}

nexusPublishing {
repositories {
sonatype {
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
33 changes: 0 additions & 33 deletions etc/release-bintray.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion etc/testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ sourceCompatibility = 1.6

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation group: 'junit', name: 'junit', version: '4.12'
implementation group: 'junit', name: 'junit', version: '4.13.2'
}

0 comments on commit 5e3b9b1

Please sign in to comment.