From 34c978c693e63e9a8afe93ab883210133301b3d9 Mon Sep 17 00:00:00 2001 From: Teodor G Date: Thu, 13 Jan 2022 13:19:01 +0200 Subject: [PATCH 1/4] [SdkIncrease] updated the sdk compile version to the last one --- demo/build.gradle | 6 +++--- memo-annotation/build.gradle | 7 +++---- memo-compiler/build.gradle | 7 +++---- memo/build.gradle | 7 +++---- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/demo/build.gradle b/demo/build.gradle index 1b8ac64..71ccbc2 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 30 + compileSdk 31 defaultConfig { applicationId "com.zeoflow.memo.demo" - minSdkVersion 21 - targetSdkVersion 30 + minSdk 21 + targetSdk 31 versionCode 1 versionName "1.0.0" } diff --git a/memo-annotation/build.gradle b/memo-annotation/build.gradle index db14159..60811f2 100644 --- a/memo-annotation/build.gradle +++ b/memo-annotation/build.gradle @@ -3,11 +3,10 @@ plugins { } android { - compileSdkVersion 30 - buildToolsVersion "30.0.3" + compileSdk 31 defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdk 21 + targetSdk 31 } compileOptions { diff --git a/memo-compiler/build.gradle b/memo-compiler/build.gradle index 6447b7f..c331a51 100644 --- a/memo-compiler/build.gradle +++ b/memo-compiler/build.gradle @@ -3,11 +3,10 @@ plugins { } android { - compileSdkVersion 30 - buildToolsVersion "30.0.3" + compileSdk 31 defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdk 21 + targetSdk 31 } compileOptions { diff --git a/memo/build.gradle b/memo/build.gradle index 7defede..0ba9f8a 100644 --- a/memo/build.gradle +++ b/memo/build.gradle @@ -3,11 +3,10 @@ plugins { } android { - compileSdkVersion 30 - buildToolsVersion "30.0.3" + compileSdk 31 defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdk 21 + targetSdk 31 } compileOptions { From 1871d1abafedd551c3203138b0297697f1a1140e Mon Sep 17 00:00:00 2001 From: Teodor G Date: Thu, 13 Jan 2022 13:42:14 +0200 Subject: [PATCH 2/4] [GradleIncrease] updated the gradle version and the java version --- .idea/compiler.xml | 2 +- build.gradle | 19 ++- demo/src/main/AndroidManifest.xml | 1 + gradle.properties | 47 +++---- gradle/wrapper/gradle-wrapper.properties | 2 +- memo-annotation/build.gradle | 4 +- memo-annotation/src/main/AndroidManifest.xml | 2 +- memo-compiler/build.gradle | 4 +- memo-compiler/src/main/AndroidManifest.xml | 2 +- memo/build.gradle | 2 - settings.gradle | 122 +++---------------- 11 files changed, 50 insertions(+), 157 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 61a9130..fb7f4a8 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5d4a0d2..a46457f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,23 +1,20 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.kotlin_version = '1.6.10' repositories { - google() mavenCentral() - jcenter() } dependencies { - classpath "com.android.tools.build:gradle:4.1.3" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.vanniktech:gradle-maven-publish-plugin:0.18.0' } } -allprojects { - repositories { - google() - mavenCentral() - jcenter() - } +plugins { + id 'com.android.application' version '7.1.0-rc01' apply false + id 'com.android.library' version '7.1.0-rc01' apply false } task clean(type: Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/demo/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml index 8e94752..b2bc5b1 100644 --- a/demo/src/main/AndroidManifest.xml +++ b/demo/src/main/AndroidManifest.xml @@ -12,6 +12,7 @@ android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning"> diff --git a/gradle.properties b/gradle.properties index 62e59bd..f75ca42 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,31 +1,24 @@ -# -# Copyright 2018 zeoflow (Jaewoong Eum) -# -# 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. -# - -# Jvm environments -org.gradle.jvmargs=-Xmx4g - -# AndroidX +# 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. +org.gradle.jvmargs=-Xmx2048m -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 +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app"s APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true - -# Required to publish to Nexus -systemProp.org.gradle.internal.publish.checksums.insecure=true - -# Increase timeout when pushing to Sonatype -systemProp.org.gradle.internal.http.connectionTimeout=120000 -systemProp.org.gradle.internal.http.socketTimeout=120000 +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true # Maven POM_NAME=Memo diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 14e30f7..a0f7639 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/memo-annotation/build.gradle b/memo-annotation/build.gradle index 60811f2..60e5d90 100644 --- a/memo-annotation/build.gradle +++ b/memo-annotation/build.gradle @@ -18,6 +18,4 @@ android { dependencies { api("androidx.annotation:annotation:1.2.0") -} - -apply from: "${rootProject.projectDir}/buildSrc/upload.gradle" +} \ No newline at end of file diff --git a/memo-annotation/src/main/AndroidManifest.xml b/memo-annotation/src/main/AndroidManifest.xml index df2d973..c654f69 100644 --- a/memo-annotation/src/main/AndroidManifest.xml +++ b/memo-annotation/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/memo-compiler/build.gradle b/memo-compiler/build.gradle index c331a51..1b8ab16 100644 --- a/memo-compiler/build.gradle +++ b/memo-compiler/build.gradle @@ -34,6 +34,4 @@ dependencies { api("com.google.guava:guava:28.2-jre") coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5") -} - -apply from: "${rootProject.projectDir}/buildSrc/upload.gradle" +} \ No newline at end of file diff --git a/memo-compiler/src/main/AndroidManifest.xml b/memo-compiler/src/main/AndroidManifest.xml index df2d973..864466e 100644 --- a/memo-compiler/src/main/AndroidManifest.xml +++ b/memo-compiler/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/memo/build.gradle b/memo/build.gradle index 0ba9f8a..8838cb0 100644 --- a/memo/build.gradle +++ b/memo/build.gradle @@ -25,5 +25,3 @@ dependencies { coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5") } - -apply from: "${rootProject.projectDir}/buildSrc/upload.gradle" diff --git a/settings.gradle b/settings.gradle index 2e662be..ed71f52 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,114 +1,22 @@ -import groovy.transform.Field - -enum BuildType { - MAIN, - COMPOSE, - FLAN, - MEDIA, - WEAR, -} - -private String getRequestedProjectSubsetName() { - if (startParameter.projectProperties.containsKey("com.zeoflow.projects")) { - return startParameter.projectProperties["com.zeoflow.projects"].toUpperCase() - } - if (System.getenv().containsKey("COM_ZEOFLOW_PROJECTS")) { - return System.getenv()["COM_ZEOFLOW_PROJECTS"].toUpperCase() - } - return null -} - -private Set createRequestedFilter() { - Set filter = new HashSet<>() - String projectSubsetName = getRequestedProjectSubsetName() - if (projectSubsetName == null) return null - String[] requestedFilter = projectSubsetName.split(",") - for (String requestedType : requestedFilter) { - switch (requestedType) { - case "MAIN": - filter.add(BuildType.MAIN) - break - case "COMPOSE": - filter.add(BuildType.COMPOSE) - break - case "FLAN": - filter.add(BuildType.FLAN) - break - case "MEDIA": - filter.add(BuildType.MEDIA) - case "WEAR": - filter.add(BuildType.WEAR) - break - case "ALL": - // Return null so that no filtering is done - return null - break - default: - throw new Exception("Unsupported project type $requestedType\n" + - "We only support the following:\n" + - "ALL - all com.zeoflow projects\n" + - "COMPOSE - compose projects\n" + - "MAIN - com.zeoflow projects that are not compose\n" + - "FLAN - fragment, lifecycle, activity, and navigation projects\n" + - "MEDIA - media, media2, and mediarouter projects\n" + - "WEAR - Wear OS projects") - } +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() } - return filter } - -/** - * Requested project filter based on STUDIO_PROJECT_FILTER env variable. - * - * Note that null value means all the projects should be included - */ -@Field -Set requestedFilter -requestedFilter = createRequestedFilter() - -boolean shouldIncludeForFilter(List includeList) { - if (includeList.empty) return true - if (requestedFilter == null) return true - for (BuildType type : includeList) { - if (requestedFilter.contains(type)) return true - } - return false -} - -// Calling includeProject(name, filePath) is shorthand for: -// -// include(name) -// project(name).projectDir = new File(filePath) -// -// Note that directly controls the Gradle project name, and also indirectly sets: -// the project name in the IDE -// the Maven artifactId -def includeProject(name, filePath, List filter = []) { - if (!shouldIncludeForFilter(filter)) return - settings.include(name) - - def file - if (filePath instanceof String) { - file = new File(rootDir, filePath) - } else { - file = filePath - } - project(name).projectDir = file - if (!file.exists()) { - // This option is supported so that development/simplify_build_failure.sh can try - // deleting entire projects at once to identify the cause of a build failure - if (System.getenv("ALLOW_MISSING_PROJECTS") == null) { - throw new Exception("Path " + file + " does not exist; cannot include project " + name) - } +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() } } -// Demo Project -includeProject(":demo", "demo") +rootProject.name = "Memo" -// Memo Components -includeProject(":memo", "memo") -includeProject(":memo-annotation", "memo-annotation") -includeProject(":memo-compiler", "memo-compiler") +include ':demo' -rootProject.name = "Memo" \ No newline at end of file +include ':memo' +include ':memo-annotation' +include ':memo-compiler' \ No newline at end of file From 48257109c5cdd7f944fe107d34642458072f15f9 Mon Sep 17 00:00:00 2001 From: Teodor G Date: Thu, 13 Jan 2022 13:45:19 +0200 Subject: [PATCH 3/4] [Dependencies] updated dependencies for the memo's libraries --- demo/build.gradle | 8 ++++---- memo-annotation/build.gradle | 2 +- memo/build.gradle | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demo/build.gradle b/demo/build.gradle index 71ccbc2..4b29d0a 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -21,9 +21,9 @@ dependencies { annotationProcessor project(path: ':memo-compiler') implementation("com.zeoflow:zson:1.3.0") - implementation("com.zeoflow:flow-kit:1.5.0") - implementation("com.zeoflow:material-elements:2.4.1") + implementation('com.zeoflow:flow-kit:1.6.2') + implementation('com.zeoflow:material-elements:2.5.0') - implementation("com.zeoflow:parcelled-runtime:1.1.0") - annotationProcessor("com.zeoflow:parcelled-compiler:1.1.0") + implementation('com.zeoflow:parcelled-runtime:1.1.1') + annotationProcessor('com.zeoflow:parcelled-compiler:1.1.1') } diff --git a/memo-annotation/build.gradle b/memo-annotation/build.gradle index 60e5d90..fc7c7e6 100644 --- a/memo-annotation/build.gradle +++ b/memo-annotation/build.gradle @@ -17,5 +17,5 @@ android { } dependencies { - api("androidx.annotation:annotation:1.2.0") + api('androidx.annotation:annotation:1.4.0-alpha01') } \ No newline at end of file diff --git a/memo/build.gradle b/memo/build.gradle index 8838cb0..b3e75e7 100644 --- a/memo/build.gradle +++ b/memo/build.gradle @@ -21,7 +21,7 @@ android { dependencies { implementation("com.zeoflow:zson:1.3.0") - implementation("androidx.annotation:annotation:1.3.0-alpha01") + implementation("androidx.annotation:annotation:1.4.0-alpha01") coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5") } From 7092ab979d241053d37510bad860ccf7b096bb3f Mon Sep 17 00:00:00 2001 From: Teodor G Date: Thu, 13 Jan 2022 13:52:45 +0200 Subject: [PATCH 4/4] [buildSrc] fixed maven deployment --- buildSrc/publish-module.gradle | 90 ++++++++++++++ buildSrc/publish.gradle | 211 +++++++++++++++++++++++++++++++++ buildSrc/upload.gradle | 105 ---------------- demo/build.gradle | 8 +- gradle.properties | 11 +- memo-annotation/build.gradle | 3 +- memo-compiler/build.gradle | 3 +- memo/build.gradle | 3 +- 8 files changed, 321 insertions(+), 113 deletions(-) create mode 100644 buildSrc/publish-module.gradle create mode 100644 buildSrc/publish.gradle delete mode 100644 buildSrc/upload.gradle diff --git a/buildSrc/publish-module.gradle b/buildSrc/publish-module.gradle new file mode 100644 index 0000000..1b5184b --- /dev/null +++ b/buildSrc/publish-module.gradle @@ -0,0 +1,90 @@ +apply plugin: 'maven-publish' +apply plugin: 'signing' +apply plugin: 'org.jetbrains.dokka' + +task androidSourcesJar(type: Jar) { + archiveClassifier.set('sources') + if (project.plugins.findPlugin("com.android.library")) { + from android.sourceSets.main.java.srcDirs + from android.sourceSets.main.kotlin.srcDirs + } else { + from sourceSets.main.java.srcDirs + from sourceSets.main.kotlin.srcDirs + } +} + +tasks.withType(dokkaHtmlPartial.getClass()).configureEach { + pluginsMapConfiguration.set( + ["org.jetbrains.dokka.base.DokkaBase": """{ "separateInheritedMembers": true}"""] + ) +} + +task javadocJar(type: Jar, dependsOn: dokkaJavadoc) { + archiveClassifier.set('javadoc') + from dokkaJavadoc.outputDirectory +} + +artifacts { + archives androidSourcesJar + archives javadocJar +} + +group = PUBLISH_GROUP_ID +version = PUBLISH_VERSION + +afterEvaluate { + publishing { + publications { + release(MavenPublication) { + groupId PUBLISH_GROUP_ID + artifactId PUBLISH_ARTIFACT_ID + version PUBLISH_VERSION + if (project.plugins.findPlugin("com.android.library")) { + from components.release + } else { + from components.java + } + + artifact androidSourcesJar + artifact javadocJar + + pom { + name = PUBLISH_ARTIFACT_ID + description = 'Stream Chat official Android SDK' + url = 'https://github.com/getstream/stream-chat-android' + licenses { + license { + name = 'Stream License' + url = 'https://github.com/GetStream/stream-chat-android/blob/main/LICENSE' + } + } + developers { + developer { + id = 'zeoflow' + name = 'ZeoFlow SRL' + email = 'open-srouce@zeoflow.com' + } + developer { + id = 'teodorhmx1' + name = 'Teodor G.' + email = 'teo@zeoflow.com' + } + } + scm { + connection = 'scm:git:github.com/getstream/stream-chat-android.git' + developerConnection = 'scm:git:ssh://github.com/getstream/stream-chat-android.git' + url = 'https://github.com/getstream/stream-chat-android/tree/main' + } + } + } + } + } +} + +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 +} \ No newline at end of file diff --git a/buildSrc/publish.gradle b/buildSrc/publish.gradle new file mode 100644 index 0000000..c3c0866 --- /dev/null +++ b/buildSrc/publish.gradle @@ -0,0 +1,211 @@ +apply plugin: 'maven-publish' + +task androidJavadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + android.libraryVariants.all { variant -> + if (variant.name == 'release') { + owner.classpath += variant.javaCompileProvider.get().classpath + } + } + + exclude '**/R.html', '**/R.*.html', '**/index.html' + options.encoding 'utf-8' + options { + addStringOption 'docencoding', 'utf-8' + addStringOption 'charset', 'utf-8' + links 'https://docs.oracle.com/javase/7/docs/api/' + links 'https://d.android.com/reference' + links 'https://developer.android.com/reference/androidx/' + } +} + +task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { + archiveClassifier.set('javadoc') + from androidJavadoc.destinationDir + + preserveFileTimestamps = false + reproducibleFileOrder = true +} + +task javaSourcesJar(type: Jar) { + archiveClassifier.set('sources') + from android.sourceSets.main.java.srcDirs + + preserveFileTimestamps = false + reproducibleFileOrder = true +} + +afterEvaluate { + publishing { + publications { + release(MavenPublication) { + + from components.release + + artifact androidJavadocJar + artifact javaSourcesJar + + groupId = GROUP + version = VERSION_NAME + + pom { + name = artifactId + description = '' + url = '' + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL +// distribution POM_LICENCE_DIST + } + } + developers { + developer { + id = 'zeoflow' + name = 'ZeoFLow SRL' + email = 'open-source@zeoflow.com' + } + developer { + id = 'teodorhmx1' + name = 'Teodor G.' + email = 'teo@zeoflow.com' + } + } + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + } + } + } + repositories { + maven { + def releasesRepoUrl = layout.buildDirectory.dir('repos/releases') + def snapshotsRepoUrl = layout.buildDirectory.dir('repos/snapshots') + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + credentials { + username NEXUS_USERNAME + password NEXUS_PASSWORD + } + } + } + } +} + +//apply plugin: 'maven-publish' +//apply plugin: 'signing' + +//afterEvaluate { +// publishing { +// publications { +// mavenRelease(MavenPublication) { +// from components.release +// } +// } +// } +//} + +//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 : "" +//} +// +//java { +// withJavadocJar() +// withSourcesJar() +//} +// +// +//afterEvaluate { +// publishing { +// publications { +// maven(MavenPublication) { +// groupId = GROUP +// artifactId = POM_ARTIFACT_ID +// version = VERSION_NAME +// pom { +// name POM_NAME +// packaging POM_PACKAGING +// description POM_DESCRIPTION +// url POM_URL +//// properties = [ +//// myProp: "value", +//// "prop.with.dots": "anotherValue" +//// ] +// licenses { +// license { +// name POM_LICENCE_NAME +// url POM_LICENCE_URL +// distribution POM_LICENCE_DIST +// } +// } +// developers { +// developer { +// id = 'zeoflow' +// name = 'ZeoFLow SRL' +// email = 'open-source@zeoflow.com' +// } +// developer { +// id = 'teodorhmx1' +// name = 'Teodor G.' +// email = 'teo@zeoflow.com' +// } +// } +// scm { +// url POM_SCM_URL +// connection POM_SCM_CONNECTION +// developerConnection POM_SCM_DEV_CONNECTION +// } +// } +// } +// } +// repositories { +// maven { +// def releasesRepoUrl = layout.buildDirectory.dir('repos/releases') +// def snapshotsRepoUrl = layout.buildDirectory.dir('repos/snapshots') +// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl +// credentials { +// username NEXUS_USERNAME +// password NEXUS_PASSWORD +// } +// } +// } +// } +//} +// +//task cleanBuildPublishLocal(type: GradleBuild) { +// tasks = ['clean', 'build', 'publishToMavenLocal'] +//} +// +//task cleanBuildPublish(type: GradleBuild) { +// tasks = ['clean', 'build', 'publish'] +//} +// +//signing { +// sign configurations.archives +//} +// +//javadoc { +// if(JavaVersion.current().isJava9Compatible()) { +// options.addBooleanOption('html5', true) +// } +//} \ No newline at end of file diff --git a/buildSrc/upload.gradle b/buildSrc/upload.gradle deleted file mode 100644 index bf9627d..0000000 --- a/buildSrc/upload.gradle +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2020 ZeoFlow - * - * 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 -> - project.generateDebugBuildConfig.enabled = false - project.generateReleaseBuildConfig.enabled = false - 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 - } - } - } - } - } - } - - signing { - required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } - sign configurations.archives - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.sourceFiles - } - - artifacts { - archives androidSourcesJar - } -} diff --git a/demo/build.gradle b/demo/build.gradle index 4b29d0a..2de19b0 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'com.android.application' +plugins { + id 'com.android.application' +} android { compileSdk 31 @@ -6,8 +8,8 @@ android { applicationId "com.zeoflow.memo.demo" minSdk 21 targetSdk 31 - versionCode 1 - versionName "1.0.0" + versionCode 10 + versionName "1.2.0" } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/gradle.properties b/gradle.properties index f75ca42..a1837af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,7 +23,7 @@ android.nonTransitiveRClass=true # Maven POM_NAME=Memo POM_PACKAGING=aar -VERSION_NAME=1.1.6 +VERSION_NAME=1.2.0 GROUP=com.zeoflow POM_DESCRIPTION=Android processing and secured library for managing SharedPreferences as key-value elements efficiently and structurally. POM_URL=https://github.com/zeoflow/memo @@ -35,4 +35,11 @@ POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt POM_LICENCE_DIST=repo POM_DEVELOPER_ID=zeoflow POM_DEVELOPER_NAME=ZeoFlow -org.gradle.daemon=true \ No newline at end of file +POM_DEVELOPER_EMAIL=open-source@zeoflow.com + +# sonatype elements +mavenCentralUsername= +mavenCentralPassword= +signing.keyId= +signing.password= +signing.secretKeyRingFile=../buildSrc/key.gpg \ No newline at end of file diff --git a/memo-annotation/build.gradle b/memo-annotation/build.gradle index fc7c7e6..d80ff61 100644 --- a/memo-annotation/build.gradle +++ b/memo-annotation/build.gradle @@ -1,5 +1,6 @@ plugins { - id 'com.android.library' + id("com.android.library") + id("com.vanniktech.maven.publish") } android { diff --git a/memo-compiler/build.gradle b/memo-compiler/build.gradle index 1b8ab16..bc4dfa4 100644 --- a/memo-compiler/build.gradle +++ b/memo-compiler/build.gradle @@ -1,5 +1,6 @@ plugins { - id 'com.android.library' + id("com.android.library") + id("com.vanniktech.maven.publish") } android { diff --git a/memo/build.gradle b/memo/build.gradle index b3e75e7..717fa3d 100644 --- a/memo/build.gradle +++ b/memo/build.gradle @@ -1,5 +1,6 @@ plugins { - id 'com.android.library' + id("com.android.library") + id("com.vanniktech.maven.publish") } android {