Skip to content

Commit

Permalink
Merge pull request #11 from barnhill/toml-version-catalog
Browse files Browse the repository at this point in the history
Toml version catalog
  • Loading branch information
barnhill authored Jun 18, 2023
2 parents ff5b6ad + b1dcba8 commit 4ac767f
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 37 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
matrix:
java: [ '17' ]

environment: build
steps:
- uses: actions/checkout@v3
- name: set up JDK ${{ matrix.java }}
Expand All @@ -27,6 +28,9 @@ jobs:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVENCENTRALPASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
REMOTE_CACHE_URL: ${{ secrets.REMOTE_CACHE_URL }}
REMOTE_CACHE_USER: ${{ secrets.REMOTE_CACHE_USER }}
REMOTE_CACHE_PASS: ${{ secrets.REMOTE_CACHE_PASS }}
run: ./gradlew clean build
- uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Android tool to output the contents sizes of saved state bundles in onSaveInstan
## Usage
To use in debug builds only use:
```Gradle
debugImplementation 'com.pnuema.android:savestateobserver:2.8.0'
debugImplementation 'com.pnuema.android:savestateobserver:2.10.0'
```
Once it has been included as a dependency it will listen for lifecycle state changes and output the following information without any code being inserted in your codebase.

Expand Down
19 changes: 13 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.application'
alias(libs.plugins.kotlin.android)
alias(libs.plugins.maven.publish)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.dokka)
alias(libs.plugins.toml.version.checker)
}

android {
namespace = 'com.pnuema.android.savestateobserver.app'
compileSdkVersion 33
Expand Down Expand Up @@ -37,8 +44,8 @@ android {

dependencies {
implementation project(":savestateobserver")
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.5.6'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.startup:startup-runtime:1.1.1'
implementation (libs.android.material)
implementation (libs.androidx.fragment.ktx)
implementation (libs.androidx.appcompat)
implementation (libs.androidx.startup)
}
30 changes: 10 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
apply plugin: 'maven-publish'
apply plugin: "com.vanniktech.maven.publish"

wrapper {
gradleVersion = '8.1'
}

buildscript {
ext.kotlin_version = '1.8.20'

repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10"
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.1'
mavenLocal()
}
}

allprojects {
repositories {
google()
mavenCentral()
}
plugins {
alias(libs.plugins.androidLibrary).apply(false)
alias(libs.plugins.kotlin.android).apply(false)
alias(libs.plugins.maven.publish).apply(false)
alias(libs.plugins.gradle.cachefix).apply(false)
}

wrapper {
gradleVersion = '8.1.1'
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android.useAndroidX=true
android.enableJetifier=false

GROUP=com.pnuema.android
VERSION_NAME=2.9.0
VERSION_NAME=2.10.0

POM_NAME=SaveStateObserver
POM_ARTIFACT_ID=savestateobserver
Expand Down
37 changes: 37 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[versions]
#libs
kotlinx-serialization = "1.5.0"
vanniktech-maven-publish = "0.25.2"
evalex = "3.0.5"
androidx-startup = "1.1.1"
androidx-appcompat = "1.6.1"
androidx-fragment-ktx = "1.6.0"
android-material = "1.9.0"
junit = "4.13.2"

#plugins
kotlin= "1.8.20"
gradlePlugins-agp = "8.0.2"
tomlChecker = "0.47.0"
gradleCacheFix = "2.7.1"
dokka = "1.8.20"

[libraries]
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
evalex = { module = "com.ezylang:EvalEx", version.ref = "evalex"}
androidx-startup = { module = "androidx.startup:startup-runtime", version.ref = "androidx-startup" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment-ktx" }
android-material = { module = "com.google.android.material:material", version.ref = "android-material" }
junit = { module = "junit:junit", version.ref = "junit" }

[plugins]
androidLibrary = { id = "com.android.library", version.ref = "gradlePlugins-agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech-maven-publish" }
gradle-cachefix = { id = "org.gradle.android.cache-fix", version.ref = "gradleCacheFix" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
toml-version-checker = { id = "com.github.ben-manes.versions", version.ref = "tomlChecker" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
20 changes: 12 additions & 8 deletions savestateobserver/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka'
apply plugin: "com.vanniktech.maven.publish"
plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.maven.publish)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.dokka)
alias(libs.plugins.toml.version.checker)
}

version = "2.9.0"
version = "2.10.0"
group = "com.pnuema.android"
archivesBaseName = 'savestateobserver'

Expand Down Expand Up @@ -47,9 +51,9 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.startup:startup-runtime:1.1.1'
testImplementation 'junit:junit:4.13.2'
implementation (libs.androidx.appcompat)
implementation (libs.androidx.startup)
testImplementation (libs.junit)
}

dokkaHtml.configure {
Expand Down
56 changes: 56 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

plugins {
id "com.gradle.enterprise" version "3.13.3"
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven { url "https://plugins.gradle.org/m2/" }
gradlePluginPortal()
google()
mavenCentral()
}
}

gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}

def cacheUrl = System.getenv("REMOTE_CACHE_URL") == null ? settings["REMOTE_CACHE_URL"] : "${System.getenv("REMOTE_CACHE_URL")}"

if (cacheUrl != null) {
buildCache {
local {
removeUnusedEntriesAfterDays = 30
}

remote(HttpBuildCache) {
url = cacheUrl
enabled = true
push = true
allowUntrustedServer = true
allowInsecureProtocol = false
if (enabled) {
println "Using remote build cache: " + cacheUrl
}
credentials {
username = System.getenv("REMOTE_CACHE_USER") == null ? settings['REMOTE_CACHE_USER'] : "${System.getenv("REMOTE_CACHE_USER")}"
password = System.getenv("REMOTE_CACHE_PASS") == null ? settings['REMOTE_CACHE_PASS'] : "${System.getenv("REMOTE_CACHE_PASS")}"
}
}
}
} else {
println "Not using remote build cache!"
}

include ':savestateobserver', ':app'

0 comments on commit 4ac767f

Please sign in to comment.