From 2a21e7e1d24560757ce6541a0a3af572881e9c2f Mon Sep 17 00:00:00 2001 From: sockeqwe Date: Thu, 8 Nov 2018 23:37:00 +0100 Subject: [PATCH] Released 0.8.15 with gradle --- annotation/build.gradle.kts | 2 + annotation/gradle.properties | 3 + autovalue/build.gradle.kts | 1 + autovalue/gradle.properties | 3 + converters/date-rfc3339/build.gradle.kts | 3 + converters/date-rfc3339/gradle.properties | 3 + converters/htmlescape/build.gradle.kts | 2 + converters/htmlescape/gradle.properties | 3 + core/build.gradle.kts | 4 +- core/gradle.properties | 3 + gradle.properties | 37 +++++++ maven-push-java-lib.gradle | 128 ++++++++++++++++++++++ processor-common/build.gradle.kts | 2 + processor-common/gradle.properties | 3 + processor/build.gradle.kts | 2 + processor/gradle.properties | 3 + retrofit-converter/build.gradle.kts | 2 + retrofit-converter/gradle.properties | 3 + 18 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 annotation/gradle.properties create mode 100644 autovalue/gradle.properties create mode 100644 converters/date-rfc3339/gradle.properties create mode 100644 converters/htmlescape/gradle.properties create mode 100644 core/gradle.properties create mode 100644 gradle.properties create mode 100644 maven-push-java-lib.gradle create mode 100644 processor-common/gradle.properties create mode 100644 processor/gradle.properties create mode 100644 retrofit-converter/gradle.properties diff --git a/annotation/build.gradle.kts b/annotation/build.gradle.kts index 8dcd6f5f..43a25f64 100644 --- a/annotation/build.gradle.kts +++ b/annotation/build.gradle.kts @@ -2,6 +2,8 @@ plugins { java } +apply(from = "../maven-push-java-lib.gradle") + dependencies { compile(project(":core")) } diff --git a/annotation/gradle.properties b/annotation/gradle.properties new file mode 100644 index 00000000..1e089e3b --- /dev/null +++ b/annotation/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME = Annotations for TikXml +POM_ARTIFACT_ID = annotation +POM_PACKAGING = jar diff --git a/autovalue/build.gradle.kts b/autovalue/build.gradle.kts index 7c24f612..15753844 100644 --- a/autovalue/build.gradle.kts +++ b/autovalue/build.gradle.kts @@ -2,6 +2,7 @@ plugins { java id("kotlin") } +apply(from = "../maven-push-java-lib.gradle") dependencies { compile(project(":core")) diff --git a/autovalue/gradle.properties b/autovalue/gradle.properties new file mode 100644 index 00000000..e8064dcf --- /dev/null +++ b/autovalue/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME = AutoValue Annotation Processor Plugin +POM_ARTIFACT_ID = auto-value-tikxml +POM_PACKAGING = jar diff --git a/converters/date-rfc3339/build.gradle.kts b/converters/date-rfc3339/build.gradle.kts index 504a802d..6281ebef 100644 --- a/converters/date-rfc3339/build.gradle.kts +++ b/converters/date-rfc3339/build.gradle.kts @@ -2,6 +2,9 @@ plugins { java } +apply(from = "$rootDir/maven-push-java-lib.gradle") + + dependencies { implementation(project(":core")) testCompile(Deps.junit) diff --git a/converters/date-rfc3339/gradle.properties b/converters/date-rfc3339/gradle.properties new file mode 100644 index 00000000..1878974a --- /dev/null +++ b/converters/date-rfc3339/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME = Date TypeConverter for rfc3393 format +POM_ARTIFACT_ID = auto-value-tikxml +POM_PACKAGING = jar diff --git a/converters/htmlescape/build.gradle.kts b/converters/htmlescape/build.gradle.kts index 504a802d..1e9f90ae 100644 --- a/converters/htmlescape/build.gradle.kts +++ b/converters/htmlescape/build.gradle.kts @@ -2,6 +2,8 @@ plugins { java } +apply(from = "$rootDir/maven-push-java-lib.gradle") + dependencies { implementation(project(":core")) testCompile(Deps.junit) diff --git a/converters/htmlescape/gradle.properties b/converters/htmlescape/gradle.properties new file mode 100644 index 00000000..8276faaf --- /dev/null +++ b/converters/htmlescape/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME = String Converter that escapes html characters +POM_ARTIFACT_ID = converter-htmlescape +POM_PACKAGING = jar diff --git a/core/build.gradle.kts b/core/build.gradle.kts index f70e33d8..b97981cd 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -2,8 +2,10 @@ plugins { java } +apply(from = "$rootDir/maven-push-java-lib.gradle") + dependencies { compile(Deps.okio) testImplementation(Deps.junit) testImplementation(Deps.assertj) -} \ No newline at end of file +} diff --git a/core/gradle.properties b/core/gradle.properties new file mode 100644 index 00000000..ae95d368 --- /dev/null +++ b/core/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME = Simple API to read and write XML +POM_ARTIFACT_ID = core +POM_PACKAGING = jar diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..32c7dca4 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,37 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m + +org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +VERSION_NAME=0.8.16-SNAPSHOT +GROUP=com.tickaroo.tikxml + +POM_DESCRIPTION=A modern XML API for Android and Java +POM_URL=https://github.com/Tickaroo/tikxml +POM_SCM_URL=https://github.com/Tickaroo/tikxml +POM_SCM_CONNECTION=scm:git@github.com:Tickaroo/tikxml.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:Tickaroo/tikxml.git +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=tickaroo +POM_DEVELOPER_NAME=Tickaroo + +android.enableAapt2=false + +signing.keyId=E1FB7CBA diff --git a/maven-push-java-lib.gradle b/maven-push-java-lib.gradle new file mode 100644 index 00000000..2fa2c6d1 --- /dev/null +++ b/maven-push-java-lib.gradle @@ -0,0 +1,128 @@ +/* + * Copyright 2013 Chris Banes + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'maven' +apply plugin: 'signing' + +def isReleaseBuild() { + return VERSION_NAME.contains("SNAPSHOT") == false +} + +def getReleaseRepositoryUrl() { + return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL : + "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +} + +def getSnapshotRepositoryUrl() { + return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL : + "https://oss.sonatype.org/content/repositories/snapshots/" +} + +def getRepositoryUsername() { + return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" +} + +def getRepositoryPassword() { + return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + pom.groupId = GROUP + pom.artifactId = POM_ARTIFACT_ID + pom.version = VERSION_NAME + + repository(url: getReleaseRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + snapshotRepository(url: getSnapshotRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + + pom.project { + name POM_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL + distribution POM_LICENCE_DIST + } + } + + developers { + developer { + id POM_DEVELOPER_ID + name POM_DEVELOPER_NAME + } + } + } + + + // Resolve dependencies to other modules + pom.whenConfigured { pom -> + pom.dependencies.findAll { dep -> dep.groupId == rootProject.name }.collect { dep -> + dep.groupId = pom.groupId = project.GROUP + dep.version = pom.version = project.VERSION_NAME + } + } + } + } + } + + signing { + required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives + } + + task javadocJar(type: Jar) { + classifier = 'javadoc' + from javadoc + + if (JavaVersion.current().isJava8Compatible()) { + allprojects { + tasks.withType(Javadoc) { + options.addStringOption('Xdoclint:none', '-quiet') + } + } + } + + } + + task sourceJar (type : Jar) { + classifier = 'sources' + from sourceSets.main.allSource + } + + artifacts { + archives javadocJar + archives sourceJar + } + +} diff --git a/processor-common/build.gradle.kts b/processor-common/build.gradle.kts index 3cd02443..53e1c528 100644 --- a/processor-common/build.gradle.kts +++ b/processor-common/build.gradle.kts @@ -3,6 +3,8 @@ plugins { id("kotlin") } +apply(from = "$rootDir/maven-push-java-lib.gradle") + dependencies { compile(project(":annotation")) compile(Deps.kotlinStdLib) diff --git a/processor-common/gradle.properties b/processor-common/gradle.properties new file mode 100644 index 00000000..5fcc19a7 --- /dev/null +++ b/processor-common/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME = Annotation Processor to generate TypeAdapters +POM_ARTIFACT_ID = processor +POM_PACKAGING = jar diff --git a/processor/build.gradle.kts b/processor/build.gradle.kts index adca303e..17574ac6 100644 --- a/processor/build.gradle.kts +++ b/processor/build.gradle.kts @@ -3,6 +3,8 @@ plugins { id("kotlin") } +apply(from = "$rootDir/maven-push-java-lib.gradle") + dependencies { compile(project(":core")) compile(project(":annotation")) diff --git a/processor/gradle.properties b/processor/gradle.properties new file mode 100644 index 00000000..3ccc952f --- /dev/null +++ b/processor/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME = Some common annotation processor logic that is shared with regular annotation processor and auto value plugin +POM_ARTIFACT_ID = processor-common +POM_PACKAGING = jar diff --git a/retrofit-converter/build.gradle.kts b/retrofit-converter/build.gradle.kts index ab96b812..1f79bf99 100644 --- a/retrofit-converter/build.gradle.kts +++ b/retrofit-converter/build.gradle.kts @@ -2,6 +2,8 @@ plugins { java } +apply(from = "$rootDir/maven-push-java-lib.gradle") + dependencies { compile(project(":core")) compile(project(":annotation")) diff --git a/retrofit-converter/gradle.properties b/retrofit-converter/gradle.properties new file mode 100644 index 00000000..3a84846a --- /dev/null +++ b/retrofit-converter/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME = Some common annotation processor logic that is shared with regular annotation processor and auto value plugin +POM_ARTIFACT_ID = retrofit-converter +POM_PACKAGING = jar