Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: normalize the gradle version between build and publish. #9

Merged
merged 1 commit into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2.3.4
- uses: gradle/wrapper-validation-action@v1.0.4
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11

- name: Assign a version
run: |
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/release.yaml

This file was deleted.

100 changes: 45 additions & 55 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,83 +1,73 @@
buildscript {
apply from: 'dependencies.gradle'
apply from: 'dependencies.gradle'

dependencies {
classpath deps.kotlinGradlePlugin
classpath "org.jetbrains.kotlin:kotlin-serialization:${versions.kotlin}"
classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.1.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.32'
classpath 'de.undercouch:gradle-download-task:4.1.1'
}
dependencies {
classpath deps.kotlinGradlePlugin
classpath "org.jetbrains.kotlin:kotlin-serialization:${versions.kotlin}"
classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.1.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.32'
classpath 'de.undercouch:gradle-download-task:4.1.1'
}

repositories {
mavenCentral()
gradlePluginPortal()
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

plugins {
id 'org.jetbrains.kotlin.jvm' version "1.5.10"
id 'org.jetbrains.kotlin.jvm' version "1.8.10"
id 'com.vanniktech.maven.publish' version "0.25.3"
}

dependencies {
compileOnly gradleApi()
compileOnly deps.kotlinGradlePlugin
compileOnly gradleApi()
compileOnly deps.kotlinGradlePlugin

implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.0'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.0'

testImplementation 'org.assertj:assertj-core:3.19.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.0-M1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.0-M1'
testImplementation 'org.junit.platform:junit-platform-gradle-plugin:1.2.0'
testImplementation 'org.jetbrains.kotlin:kotlin-test:1.4.32'
testImplementation 'org.assertj:assertj-core:3.19.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.0-M1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.0-M1'
testImplementation 'org.junit.platform:junit-platform-gradle-plugin:1.2.0'
testImplementation 'org.jetbrains.kotlin:kotlin-test:1.4.32'
}

repositories {
mavenCentral()
google()
mavenCentral()
google()
}

test {
useJUnitPlatform()
useJUnitPlatform()

testLogging {
if (System.getenv("CI") == "true") {
events = ["failed", "skipped", "passed"]
testLogging {
if (System.getenv("CI") == "true") {
events = ["failed", "skipped", "passed"]
}
exceptionFormat "full"
}
exceptionFormat "full"
}
}

apply plugin: 'com.vanniktech.maven.publish'
import com.vanniktech.maven.publish.SonatypeHost

mavenPublish {
targets {
installArchives {
def url = file("${rootProject.buildDir}/localMaven").toURI().toString()
releaseRepositoryUrl = url
snapshotRepositoryUrl = url
}
}
}

signing {
def signingKey = findProperty('signingKey')
def signingPassword = ''
useInMemoryPgpKeys(signingKey, signingPassword)
mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT, true)
signAllPublications()
}

apply plugin: 'com.diffplug.spotless'

spotless {
kotlin {
target('**/*.kt')
licenseHeaderFile(rootProject.file('gradle/license-header.txt'))
// Spotless doesn't read .editorconfig yet: https://github.com/diffplug/spotless/issues/142
ktlint('0.41.0').userData([
'insert_final_newline': 'true',
'end_of_line': 'lf',
'indent_size': '2',
])
}
kotlin {
target('**/*.kt')
licenseHeaderFile(rootProject.file('gradle/license-header.txt'))
// Spotless doesn't read .editorconfig yet: https://github.com/diffplug/spotless/issues/142
ktlint('0.41.0').userData([
'insert_final_newline': 'true',
'end_of_line' : 'lf',
'indent_size' : '2',
])
}
}
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.versions = [
'kotlin': '1.5.10',
'kotlin': '1.9.0',
]
ext.deps = [
'kotlinGradlePlugin': "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
Expand Down
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ POM_DEVELOPER_NAME=CashApp
POM_DEVELOPER_URL=https://github.com/cashapp/

systemProp.org.gradle.internal.http.socketTimeout=120000

VERSION_NAME=1.0.0-SNAPSHOT
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading