Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from 2BAB/dev_v2
Bump AGP to 4.1.2, Gradle to 7.0; CI and MavenCentral release setup.
- Loading branch information
Showing
77 changed files
with
957 additions
and
470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '*.md' | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '*.md' | ||
|
||
env: | ||
CI: true | ||
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dkotlin.incremental=false | ||
TERM: dumb | ||
|
||
jobs: | ||
assemble: | ||
name: Assemble | ||
runs-on: ubuntu-latest | ||
env: | ||
JAVA_TOOL_OPTIONS: -Xmx4g | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ github.job }}- | ||
- run: | | ||
./gradlew assembleDebug | ||
checks: | ||
name: Checks (unit tests and static analysis, TODO:add detekt check after set it up) | ||
runs-on: ubuntu-latest | ||
env: | ||
JAVA_TOOL_OPTIONS: -Xmx4g | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ github.job }}- | ||
- run: | | ||
./gradlew :scratch-paper:plugin:test | ||
functional-tests: | ||
name: Functional tests | ||
runs-on: ubuntu-latest | ||
env: | ||
JAVA_TOOL_OPTIONS: -Xmx4g | ||
AGP_VERSION: ${{ matrix.agp-version }} | ||
strategy: | ||
matrix: | ||
agp-version: [ 4.1.2] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-${{ github.job }}-${{ matrix.agp-version }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ github.job }}-${{ matrix.agp-version }}- | ||
- run: | | ||
./gradlew :scratch-paper:plugin:functionalTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
scratch-paper-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
|
||
- name: Prepare environment | ||
env: | ||
SIGNING_SECRET_KEY_CONTENT: ${{ secrets.SIGNING_SECRET_KEY_CONTENT }} | ||
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} | ||
run: | | ||
git fetch --unshallow | ||
sudo bash -c "echo '$SIGNING_SECRET_KEY_CONTENT' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'" | ||
- name: Build & Release ScratchPaper plugin to Maven Central | ||
run: chmod +x ./publish.sh | ./publish.sh | ||
env: | ||
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | ||
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | ||
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} | ||
SIGNING_SECRET_KEY_CONTENT: ${{ secrets.SIGNING_SECRET_KEY_CONTENT }} | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
GH_DEV_TOKEN: ${{ secrets.GH_DEV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.DS_Store | ||
.idea/ | ||
.gradle/ | ||
build | ||
*.iml | ||
.gradle/ | ||
local.properties | ||
.idea/ | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,30 @@ | ||
// must keep the order among `buildscript` `plugins` `repositories` blocks | ||
buildscript { | ||
group = "me.2bab" | ||
version = "2.5.3" | ||
|
||
val props = java.util.Properties() | ||
file("./scratch-paper/buildSrc/src/main/resources/versions.properties").inputStream().use { props.load(it) } | ||
|
||
repositories { | ||
google() | ||
jcenter() | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
classpath(kotlin("gradle-plugin", version = props["kotlinVersion"]?.toString())) | ||
classpath("com.android.tools.build:gradle:${props["agpVersion"]?.toString()}") | ||
classpath("me.2bab:scratchpaper:+") | ||
} | ||
} | ||
|
||
plugins { | ||
kotlin("jvm") version "1.3.72" | ||
`bintray-plugin` | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
google() | ||
jcenter() | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
} | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
|
||
configurations.all { | ||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jre7") | ||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jre8") | ||
} | ||
|
||
dependencies { | ||
implementation(gradleApi()) | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect") | ||
implementation("com.android.tools.build:gradle:4.0.0") | ||
implementation("org.jfree:jfreesvg:3.3") | ||
} | ||
|
||
tasks.compileJava { | ||
options.compilerArgs.plusAssign(arrayOf("-proc:none")) | ||
} | ||
|
||
|
||
project.extra["travisBuild"] = System.getenv("TRAVIS") == "true" | ||
|
||
if (project.extensions.findByName("buildScan") != null) { | ||
gradleEnterprise { | ||
buildScan { | ||
termsOfServiceUrl = "https://gradle.com/terms-of-service" | ||
termsOfServiceAgree = "yes" | ||
} | ||
} | ||
task("clean") { | ||
delete(rootProject.buildDir) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.