Skip to content

Commit

Permalink
Release/3.8.0 (#25)
Browse files Browse the repository at this point in the history
* Upgrade to AGP 7 & Kotlin 1.7

* Update publishing library

* Fix CI

* Removed Dexter

* Fix CI

* Fixed CI vulnerabilities

* Removed deprecated APIs

* Added publishAllToCentral

* Enable signing

* Update copyrights

* compile only annotation
  • Loading branch information
anggrayudi authored Nov 26, 2022
1 parent 34b2b88 commit 5cd9b86
Show file tree
Hide file tree
Showing 26 changed files with 269 additions and 232 deletions.
4 changes: 4 additions & 0 deletions .github/scripts/copy_env_variables.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Append suffix -SNAPSHOT
if [[ ! ($(grep "MATERIAL_PREFERENCE_VERSION=" gradle.properties) == *"-SNAPSHOT") ]]; then
sed -ie "s/MATERIAL_PREFERENCE_VERSION.*$/&-SNAPSHOT/g" gradle.properties
fi

if [[ ! ($(grep "PROCESSOR_VERSION=" gradle.properties) == *"-SNAPSHOT") ]]; then
sed -ie "s/PROCESSOR_VERSION.*$/&-SNAPSHOT/g" gradle.properties
rm -f gradle.propertiese
fi

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/deploy_snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ elif [ "${GITHUB_REF##*/}" != "master" ]; then
echo "Skipping deployment: wrong branch. Expected 'master' but was '${GITHUB_REF##*/}'."
else
echo "Deploying snapshot..."
./gradlew :materialpreference:uploadArchives --no-daemon --no-parallel --stacktrace
./gradlew :materialpreference:publishAllPublicationsToMavenCentral --no-daemon --no-parallel --stacktrace
echo "Snapshot released!"
fi
18 changes: 15 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,31 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup JDK 1.8
- name: Setup JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11

- name: Copy environment variables
run: ./.github/scripts/copy_env_variables.sh

- name: Build with Gradle
if: ${{ github.repository_owner == 'anggrayudi' }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSS_SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSS_SONATYPE_NEXUS_PASSWORD }}
run: ./gradlew build test check

- name: Build with Gradle (default)
if: ${{ github.repository_owner != 'anggrayudi' }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: 'abc'
ORG_GRADLE_PROJECT_mavenCentralPassword: 'xyz'
run: ./gradlew build test check

- name: Upload snapshot archives
if: ${{ github.repository_owner == 'anggrayudi' }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSS_SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSS_SONATYPE_NEXUS_PASSWORD }}
run: ./.github/scripts/deploy_snapshot.sh
run: ./.github/scripts/deploy_snapshot.sh
17 changes: 17 additions & 0 deletions .run/publish.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="publishMaterialPreferenceToCentral" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="./gradlew :materialpreference:publishAllPublicationsToMavenCentral" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
17 changes: 17 additions & 0 deletions .run/publishAllToCentral.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="publishAllToCentral" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="./gradlew publishAllPublicationsToMavenCentral" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
17 changes: 17 additions & 0 deletions .run/publishToLocal.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="publishAllToLocal" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="./gradlew publishToMavenLocal" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright © 2018-2021 Anggrayudi Hardiannicko A.
Copyright © 2018-2022 Anggrayudi Hardiannicko A.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ apply plugin: 'kotlin-kapt' // Add this line
dependencies {
implementation 'com.anggrayudi:materialpreference:3.x.x'
kapt 'com.anggrayudi:materialpreference-compiler:1.7'
kapt 'com.anggrayudi:materialpreference-compiler:1.8'
}
````

Expand Down Expand Up @@ -328,7 +328,7 @@ Don't forget to check this runtime permission before opening ringtone picker on

## License

Copyright 2018-2021 Anggrayudi Hardiannicko A.
Copyright 2018-2022 Anggrayudi Hardiannicko A.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
16 changes: 4 additions & 12 deletions annotation/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
apply plugin: 'java-library'
apply plugin: 'kotlin'

group = 'com.anggrayudi'
version = "$PROCESSOR_VERSION"
archivesBaseName = 'materialpreference-api'
archivesBaseName = "$POM_ARTIFACT_ID"

compileKotlin {
kotlinOptions {
Expand All @@ -18,14 +17,7 @@ compileTestKotlin {
}
}

ext {
// POM
POM_ARTIFACT_ID = archivesBaseName
VERSION_NAME = version

POM_NAME = archivesBaseName
POM_PACKAGING = 'jar'
POM_DESCRIPTION = 'Annotation processor API for library MaterialPreference.'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

apply plugin: "com.vanniktech.maven.publish"
3 changes: 3 additions & 0 deletions annotation/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=materialpreference-api
POM_NAME=materialpreference-api
POM_DESCRIPTION=Annotation processor API for library MaterialPreference.
41 changes: 28 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apply from: 'extensions.gradle'

buildscript {
ext.kotlin_version = '1.5.10'
ext.kotlin_version = '1.7.20'

repositories {
google()
Expand All @@ -11,11 +11,11 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.8'
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.google.gms:google-services:4.3.14'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.15.1'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.20'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.22.0'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.7.20'
}
}

Expand All @@ -25,18 +25,33 @@ allprojects {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}

subprojects {
if (name != 'sample') {
apply plugin: "com.vanniktech.maven.publish"

//Support @JvmDefault
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
freeCompilerArgs = ['-Xjvm-default=all', '-Xopt-in=kotlin.RequiresOptIn']
jvmTarget = '1.8'
includeRuntime = true
repositories {
maven {
url = version.toString().endsWith("SNAPSHOT")
? 'https://oss.sonatype.org/content/repositories/snapshots/'
: 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
}
}
}

configurations.all {
resolutionStrategy {
// Force Kotlin to use current version
force "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-android-extensions-runtime:$kotlin_version"
force "junit:junit:4.13.2"
}
}
}

subprojects {
afterEvaluate {
// global dependencies for all modules
dependencies {
Expand Down
29 changes: 3 additions & 26 deletions extensions.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
ext {
appVersionCode = 19
minSdkVersion = 17
targetSdkVersion = 30
compileSdkVersion = 30
buildToolsVersion = '30.0.2'
targetSdkVersion = 33
compileSdkVersion = 33
dialogVersion = '3.3.0'
coroutinesVersion = '1.4.3'

// Project
VCS_URL = "https://github.com/anggrayudi/MaterialPreference.git"
GROUP = "com.anggrayudi"

// POM Project
POM_URL = "https://github.com/anggrayudi/MaterialPreference"

// POM SCM
POM_SCM_URL = "https://github.com/anggrayudi/MaterialPreference"
POM_SCM_CONNECTION = "scm:git:git://github.com/anggrayudi/MaterialPreference.git"
POM_SCM_DEV_CONNECTION = "scm:git:ssh://github.com:anggrayudi/MaterialPreference.git"

// POM Licenses
POM_LICENCE_NAME = "The Apache Software License, Version 2.0"
POM_LICENCE_URL = "https://github.com/anggrayudi/MaterialPreference/blob/master/LICENSE"
//POM_LICENCE_DIST = "

// POM Developers
POM_DEVELOPER_ID = "anggrayudi"
POM_DEVELOPER_NAME = "Anggrayudi H"
POM_DEVELOPER_URL = "https://github.com/anggrayudi/"
coroutinesVersion = '1.6.4'
}
20 changes: 18 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,21 @@ org.gradle.daemon=false
#kapt.incremental.apt=true
#kapt.use.worker.api=true
# ------- Library versions
PROCESSOR_VERSION=1.7
MATERIAL_PREFERENCE_VERSION=3.7.1
PROCESSOR_VERSION=1.8
MATERIAL_PREFERENCE_VERSION=3.8.0-SNAPSHOT
# For publishing:
GROUP=com.anggrayudi
SONATYPE_HOST=DEFAULT
SONATYPE_AUTOMATIC_RELEASE=true
RELEASE_SIGNING_ENABLED=true
POM_INCEPTION_YEAR=2018
POM_URL=https://github.com/anggrayudi/MaterialPreference
POM_LICENSE_NAME=The Apache Software License, Version 2.0
POM_LICENSE_URL=https://github.com/anggrayudi/MaterialPreference/blob/master/LICENSE
POM_LICENSE_DIST=https://www.apache.org/licenses/LICENSE-2.0.txt
POM_SCM_URL=https://github.com/anggrayudi/MaterialPreference
POM_SCM_CONNECTION=scm:git:git://github.com/anggrayudi/MaterialPreference.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com:anggrayudi/MaterialPreference.git
POM_DEVELOPER_ID=anggrayudi
POM_DEVELOPER_NAME=Anggrayudi H
POM_DEVELOPER_URL=https://github.com/anggrayudi/
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
26 changes: 9 additions & 17 deletions materialpreference/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

group = 'com.anggrayudi'
version = "$MATERIAL_PREFERENCE_VERSION"
archivesBaseName = "$POM_ARTIFACT_ID"

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
Expand All @@ -33,33 +32,26 @@ android {
}

dependencies {
api 'androidx.appcompat:appcompat:1.3.0'
api 'com.google.android.material:material:1.3.0'
api 'androidx.appcompat:appcompat:1.5.1'
api 'com.google.android.material:material:1.7.0'
api 'androidx.documentfile:documentfile:1.0.1'
api 'androidx.cardview:cardview:1.0.0'

api 'com.karumi:dexter:6.2.2'
api 'com.wdullaer:materialdatetimepicker:4.2.3'
api "com.afollestad.material-dialogs:core:$dialogVersion"
api "com.afollestad.material-dialogs:files:$dialogVersion"
api "com.afollestad.material-dialogs:color:$dialogVersion"
api "com.anggrayudi:materialpreference-api:$PROCESSOR_VERSION"
compileOnly project(':annotation')

api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"

api "com.anggrayudi:storage:0.8.0"
// api("com.anggrayudi:storage:0.6.0-SNAPSHOT") { changing = true }
api "com.anggrayudi:storage:1.5.1"
// api("com.anggrayudi:storage:1.5.1-SNAPSHOT") { changing = true }
}

ext {
// POM
POM_ARTIFACT_ID = archivesBaseName
VERSION_NAME = version

POM_NAME = archivesBaseName
POM_PACKAGING = 'aar'
POM_DESCRIPTION = 'A library designed to replace default preferences on Android framework with something beauty.'
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

apply plugin: "com.vanniktech.maven.publish"
3 changes: 3 additions & 0 deletions materialpreference/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=materialpreference
POM_NAME=materialpreference
POM_DESCRIPTION=A library designed to replace default preferences on Android framework with something beauty.
Loading

0 comments on commit 5cd9b86

Please sign in to comment.