Skip to content

Commit

Permalink
Update to Kotlin 1.4.30 and Maven Central for publishing (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmook authored Feb 20, 2021
1 parent 820eb1c commit cbacd8b
Show file tree
Hide file tree
Showing 24 changed files with 350 additions and 269 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

58 changes: 23 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ on:
branches:
- main

env:
CI: "true"

jobs:
build:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1

build:
needs: [validation]
runs-on: ubuntu-latest

steps:
Expand All @@ -26,41 +30,25 @@ jobs:
with:
java-version: 1.8

- name: gradle cache
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: gradle wrapper cache
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper/dists
key: ${{ runner.os }}-gradlewrapper
- name: Build with Gradle
run: ./gradlew assemble check --stacktrace

- name: NVD CVE cache
uses: actions/cache@v1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.6
with:
path: ~/.gradle/dependency-check-data
key: ${{ runner.os }}-dependency-check-data

- name: Build with Gradle
run: ./gradlew --build-cache assemble check --stacktrace
token: ${{secrets.CODECOV_TOKEN}}

- name: Set tag version
run: echo "CIRCLE_TAG=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
- name: Prepare tag properties
run: |
echo "${{secrets.GPG_SIGNING_SECRET_KEY_RING_FILE_BASE64}}" > ~/.gradle/sonatype-appmattus-keys.gpg.b64
base64 -d ~/.gradle/sonatype-appmattus-keys.gpg.b64 > ~/.gradle/sonatype-appmattus-keys.gpg
echo "${{secrets.GPG_GRADLE_PROPERTIES}}" > ~/.gradle/gradle.properties
if: startsWith(github.ref, 'refs/tags/')

- name: Upload tag
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
run: ./gradlew bintrayUpload
run: ./gradlew publish --no-daemon --no-parallel -Psigning.secretKeyRingFile=$(echo ~/.gradle/sonatype-appmattus-keys.gpg)
if: startsWith(github.ref, 'refs/tags/')

- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
- name: Close and release tag
run: ./gradlew closeAndReleaseRepository
if: startsWith(github.ref, 'refs/tags/')
27 changes: 9 additions & 18 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions .idea/libraries-with-intellij-classes.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Appmattus Limited
* Copyright 2021 Appmattus Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,24 +14,24 @@
* limitations under the License.
*/

import com.android.build.gradle.internal.tasks.factory.dependsOn
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaPlugin
import org.jetbrains.dokka.gradle.DokkaTask
import java.net.URL

plugins {
kotlin("jvm") version "1.4.10" apply false
id("io.gitlab.arturbosch.detekt") version "1.14.2"
id("com.appmattus.markdown") version "0.6.0"
id("org.jetbrains.dokka") version "1.4.10.2"
kotlin("jvm") version Versions.kotlin apply false
id("io.gitlab.arturbosch.detekt") version Versions.detektGradlePlugin
id("com.appmattus.markdown") version Versions.markdownlintGradlePlugin
id("com.vanniktech.maven.publish") version Versions.gradleMavenPublishPlugin apply false
id("org.jetbrains.dokka") version Versions.dokkaPlugin
}

buildscript {
repositories {
google()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath("com.android.tools.build:gradle:${Versions.androidGradlePlugin}")
}
}

Expand All @@ -46,17 +46,24 @@ allprojects {
maven { setUrl("https://jitpack.io") }
}

tasks.withType<DokkaTask> {
outputDirectory.set(buildDir.resolve("reports/dokka"))
version = (System.getenv("GITHUB_REF") ?: System.getProperty("GITHUB_REF"))
?.replaceFirst("refs/tags/", "") ?: "unspecified"

dokkaSourceSets {
configureEach {
skipDeprecated.set(true)
plugins.withType<DokkaPlugin> {
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
configureEach {
skipDeprecated.set(true)

sourceLink {
localDirectory.set(rootDir)
remoteUrl.set(URL("https://github.com/appmattus/kotlinfixture/blob/main/"))
remoteLineSuffix.set("#L")
if (name.startsWith("ios")) {
displayName.set("ios")
}

sourceLink {
localDirectory.set(rootDir)
remoteUrl.set(URL("https://github.com/appmattus/kotlinfixture/blob/main"))
remoteLineSuffix.set("#L")
}
}
}
}
Expand All @@ -68,7 +75,7 @@ tasks.register<Delete>("clean") {
}

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.14.2")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${Versions.detektGradlePlugin}")
}

detekt {
Expand All @@ -80,10 +87,3 @@ detekt {

config = files("detekt-config.yml")
}

val dokka = tasks.named<DokkaMultiModuleTask>("dokkaHtmlMultiModule") {
outputDirectory.set(buildDir.resolve("dokkaCustomMultiModuleOutput"))
// documentationFileName.set("module.md")
}

tasks.register("check").dependsOn(dokka)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Appmattus Limited
* Copyright 2021 Appmattus Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,9 +14,22 @@
* limitations under the License.
*/

tasks.register<Jar>("dokkaJar") {
dependsOn(tasks.named("dokkaJavadoc"))
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

archiveClassifier.set("javadoc")
from("$buildDir/reports/dokka")
plugins {
`kotlin-dsl`
}

repositories {
jcenter()
}

kotlinDslPluginOptions {
experimentalWarning.set(false)
}

tasks.withType(KotlinCompile::class.java).all {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
Loading

0 comments on commit cbacd8b

Please sign in to comment.