Skip to content

Commit

Permalink
Merge pull request #26 from erikeelde/develop
Browse files Browse the repository at this point in the history
Toggles core 0.0.1 release
  • Loading branch information
erikeelde authored Mar 22, 2021
2 parents 5c527eb + d386332 commit 729fc86
Show file tree
Hide file tree
Showing 101 changed files with 1,649 additions and 1,091 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/manual-release-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Manual release workflow

on:
workflow_dispatch:

jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out code
uses: actions/checkout@v2

- name:
run: |
echo "${{secrets.SECRING_GPG_B64}}" > ~/.gradle/secring.gpg.b64
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg
touch ~/.gradle/gradle.properties
echo "signing.keyId=${{secrets.SIGNING_KEYID}}" >> ~/.gradle/gradle.properties
echo "signing.password=${{secrets.SIGNING_PASSWORD}}" >> ~/.gradle/gradle.properties
echo "signing.secretKeyRingFile=~/.gradle/secring.gpg" >> ~/.gradle/gradle.properties
echo "mavenCentralRepositoryUsername=${{secrets.MAVEN_CENTRAL_REPOSITORY_USERNAME}}" >> ~/.gradle/gradle.properties
echo "mavenCentralRepositoryPassword=${{secrets.MAVEN_CENTRAL_REPOSITORY_PASSWORD}}" >> ~/.gradle/gradle.properties
- name: Check out java
uses: actions/setup-java@v1
with:
java-version: 11

- name: Run Detekt
run: ./gradlew :toggles-core:detekt

- name: Run Android Lint
run: ./gradlew :toggles-core:lint

- name: Run Android Unit test
run: ./gradlew :toggles-core:testDebugUnitTest

- name: Publish core library
run: ./gradlew :toggles-core:publish --no-daemon --no-parallel
44 changes: 44 additions & 0 deletions .github/workflows/manual-release-flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Manual release workflow

on:
workflow_dispatch:

jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out code
uses: actions/checkout@v2

- name:
run: |
echo "${{secrets.SECRING_GPG_B64}}" > ~/.gradle/secring.gpg.b64
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg
touch ~/.gradle/gradle.properties
echo "signing.keyId=${{secrets.SIGNING_KEYID}}" >> ~/.gradle/gradle.properties
echo "signing.password=${{secrets.SIGNING_PASSWORD}}" >> ~/.gradle/gradle.properties
echo "signing.secretKeyRingFile=~/.gradle/secring.gpg" >> ~/.gradle/gradle.properties
echo "mavenCentralRepositoryUsername=${{secrets.MAVEN_CENTRAL_REPOSITORY_USERNAME}}" >> ~/.gradle/gradle.properties
echo "mavenCentralRepositoryPassword=${{secrets.MAVEN_CENTRAL_REPOSITORY_PASSWORD}}" >> ~/.gradle/gradle.properties
- name: Check out java
uses: actions/setup-java@v1
with:
java-version: 11

- name: Run Detekt
run: ./gradlew :toggles-flow:detekt

- name: Run Android Lint
run: ./gradlew :toggles-flow:lint

- name: Run Android Unit test
run: ./gradlew :toggles-flow:testDebugUnitTest

- name: Publish flow library
run: ./gradlew :toggles-flow:publish --no-daemon --no-parallel
44 changes: 44 additions & 0 deletions .github/workflows/manual-release-prefs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Manual release workflow

on:
workflow_dispatch:

jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out code
uses: actions/checkout@v2

- name:
run: |
echo "${{secrets.SECRING_GPG_B64}}" > ~/.gradle/secring.gpg.b64
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg
touch ~/.gradle/gradle.properties
echo "signing.keyId=${{secrets.SIGNING_KEYID}}" >> ~/.gradle/gradle.properties
echo "signing.password=${{secrets.SIGNING_PASSWORD}}" >> ~/.gradle/gradle.properties
echo "signing.secretKeyRingFile=~/.gradle/secring.gpg" >> ~/.gradle/gradle.properties
echo "mavenCentralRepositoryUsername=${{secrets.MAVEN_CENTRAL_REPOSITORY_USERNAME}}" >> ~/.gradle/gradle.properties
echo "mavenCentralRepositoryPassword=${{secrets.MAVEN_CENTRAL_REPOSITORY_PASSWORD}}" >> ~/.gradle/gradle.properties
- name: Check out java
uses: actions/setup-java@v1
with:
java-version: 11

- name: Run Detekt
run: ./gradlew :toggles-prefs:detekt

- name: Run Android Lint
run: ./gradlew :toggles-prefs:lint

- name: Run Android Unit test
run: ./gradlew :toggles-prefs:testDebugUnitTest

- name: Publish core library
run: ./gradlew :toggles-prefs:publish --no-daemon --no-parallel
2 changes: 1 addition & 1 deletion .github/workflows/manual-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Check out java
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11

- name: Run Detekt
run: ./gradlew detekt
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Check out java
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11

- name: Build apks
run: ./gradlew :toggles-app:packageDebug :toggles-sample:packageDebug
Expand All @@ -29,3 +29,4 @@ jobs:
with:
name: Apks
path: '**/build/outputs/apk/*'
retention-days: 14
5 changes: 3 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Check out java
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11

- name: Run Detekt
run: ./gradlew detekt
Expand All @@ -35,4 +35,5 @@ jobs:
if: failure()
with:
name: Reports
path: '**/build/reports/*'
path: '**/build/reports/*'
retention-days: 2
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Stores settings / toggles behind a content provider.

This is a development tools meant to facilitate feature switching in an external app so that configurations will be retained across clear data / uninstalls.

2 premade libraries to talk to the toggles application. "Prefs" and "Coroutines":
2 premade libraries to talk to the toggles application. "Prefs" and "Flow":

## Toggles-coroutines library
Exposes switches from toggles using a kotlin stream.
## Toggles-flow library
Exposes switches from toggles using a kotlin flow.

## Toggles-prefs library
One-shot fetch of a toggle. Similar API as androids SharedPreferences.
Expand Down
35 changes: 21 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {

val composeVersion by extra("1.0.0-beta02")

repositories {
google()
mavenCentral()
Expand All @@ -10,29 +13,33 @@ buildscript {
}

dependencies {
classpath("com.android.tools:r8:2.1.75")
classpath("com.android.tools.build:gradle:4.1.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.3.2")
classpath("com.android.tools.build:gradle:7.0.0-alpha10")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.3.4")
classpath("com.google.gms:oss-licenses:0.9.2")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.30.1-alpha")
// https://github.com/Triple-T/gradle-play-publisher/issues/864
classpath("com.github.triplet.gradle:play-publisher:3.0.0")
classpath("com.google.gms:google-services:4.3.4")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.33-beta")
classpath("com.google.gms:google-services:4.3.5")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.14.2")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.4.30")
}
}

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.15.0")
}

plugins {
id("com.github.ben-manes.versions") version "0.36.0"
id("com.github.ben-manes.versions") version "0.38.0"
id("se.eelde.build-optimizations") version "0.2.0"
id("io.gitlab.arturbosch.detekt") version "1.14.2"
id("io.gitlab.arturbosch.detekt") version "1.16.0"
}

allprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.16.0")
}
detekt {
autoCorrect = true
}

repositories {
google()
mavenCentral()
Expand Down
16 changes: 13 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
# 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=-Xmx2g
org.gradle.jvmargs=-Xmx2g -Xms500m -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.3
VERSION_CODE=5
GROUP=se.eelde.toggles
POM_DESCRIPTION=Toggles
POM_INCEPTION_YEAR=2018
POM_URL=https://github.com/erikeelde/toggles
POM_SCM_URL=https://github.com/erikeelde/toggles
POM_SCM_CONNECTION=scm:[email protected]:erikeelde/toggles.git
Expand All @@ -24,10 +24,20 @@ POM_LICENCE_URL=https://raw.githubusercontent.com/erikeelde/toggles/master/LICEN
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=erikeelde, warting
POM_DEVELOPER_NAME=Erik Eelde, Stefan Wärting

RELEASE_REPOSITORY_URL=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
SNAPSHOT_REPOSITORY_URL=https://s01.oss.sonatype.org/content/repositories/snapshots/
# Enable rudimentary R class namespacing where each library only contains
# references to the resources it declares instead of declarations plus all
# transitive dependency references.
# android.namespacedRClass=false # deprecated - use android.nonTransitiveRClass now
android.nonTransitiveRClass=false
android.useAndroidX=true
android.enableJetifier=false

#kotlin.caching.enabled=true # default false
#kotlin.incremental.usePreciseJavaTracking=true #default false
#kapt.use.worker.api=true
#kapt.include.compile.classpath=false
#kapt.incremental.apt=true
#kotlin.parallel.tasks.in.project=true
Loading

0 comments on commit 729fc86

Please sign in to comment.