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

Restore compatibility with Java 8 #22

Merged
merged 3 commits into from
Dec 31, 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
22 changes: 7 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,21 @@ jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
GRADLE_OPTS: -Dorg.gradle.java.installations.fromEnv=JAVA_HOME_8_x64,JAVA_HOME_11_x64,JAVA_HOME_17_x64
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java 8
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- name: Setup Java 11
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: |
8
11
21
17

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
Expand Down
51 changes: 13 additions & 38 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@ plugins {
id("java-library")
id("maven-publish")

id("org.ajoberstar.reckon")
id("com.diffplug.spotless")
}

group = "dev.clojurephant"

reckon {
setDefaultInferredScope("patch")
stages("alpha", "beta", "rc", "final")
setScopeCalc(calcScopeFromProp().or(calcScopeFromCommitMessages()))
setStageCalc(calcStageFromProp())
}

java {
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

sourceSets {
Expand All @@ -41,13 +36,13 @@ clojure {

dependencies {
api("org.junit.platform:junit-platform-engine:latest.release")
api("org.clojure:clojure:latest.release")
api("org.clojure:clojure:1.11.1")
api("org.clojure:tools.namespace:latest.release")

testImplementation("junit:junit:latest.release")
testImplementation("org.junit.platform:junit-platform-launcher:latest.release")

"sampleImplementation"("org.clojure:clojure:latest.release")
"sampleImplementation"("org.clojure:clojure:1.11.1")
}

tasks.named<Jar>("jar") {
Expand All @@ -64,41 +59,17 @@ tasks.named<Test>("test") {
systemProperty("classpath.roots", file("src/sample/clojure"))
}

////////////////////////////////////////////////////////////////////////////////
// Linting
////////////////////////////////////////////////////////////////////////////////
spotless {
java {
importOrder("java", "javax", "")
removeUnusedImports()
eclipse().configFile(project.rootProject.file("gradle/eclipse-java-formatter.xml"))
}
}

////////////////////////////////////////////////////////////////////////////////
// Dependency locking
////////////////////////////////////////////////////////////////////////////////
sourceSets.configureEach {
configurations[compileClasspathConfigurationName].resolutionStrategy.activateDependencyLocking()
configurations[runtimeClasspathConfigurationName].resolutionStrategy.activateDependencyLocking()
dependencyLocking {
lockAllConfigurations()
}

tasks.register("lock") {
doFirst {
assert(gradle.startParameter.isWriteDependencyLocks())
}
doLast {
sourceSets.all {
configurations[compileClasspathConfigurationName].resolve()
configurations[runtimeClasspathConfigurationName].resolve()
}
}
}

////////////////////////////////////////////////////////////////////////////////
// Publishing
////////////////////////////////////////////////////////////////////////////////

publishing {
repositories {
maven {
Expand All @@ -116,8 +87,12 @@ publishing {
from(components["java"])

versionMapping {
usage("java-api") { fromResolutionOf("runtimeClasspath") }
usage("java-runtime") { fromResolutionResult() }
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}

pom {
Expand Down
18 changes: 9 additions & 9 deletions gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
junit:junit:4.13.2=devCompileClasspath,devRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
nrepl:nrepl:0.9.0=devCompileClasspath,devRuntimeClasspath
nrepl:nrepl:0.9.0=devCompileClasspath,devRuntimeClasspath,nrepl
org.apiguardian:apiguardian-api:1.1.2=compileClasspath,devCompileClasspath,testCompileClasspath
org.clojure:clojure:1.12.0-alpha1=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,sampleCompileClasspath,sampleRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.clojure:clojure:1.11.1=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,sampleCompileClasspath,sampleRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.clojure:core.specs.alpha:0.2.62=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,sampleCompileClasspath,sampleRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.clojure:java.classpath:1.0.0=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.clojure:spec.alpha:0.3.218=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,sampleCompileClasspath,sampleRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.clojure:tools.namespace:1.3.0=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.clojure:tools.namespace:1.4.4=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.clojure:tools.reader:1.3.6=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.hamcrest:hamcrest-core:1.3=devCompileClasspath,devRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-commons:1.9.0=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-engine:1.9.0=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-launcher:1.9.0=devCompileClasspath,devRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit:junit-bom:5.9.0=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.opentest4j:opentest4j:1.2.0=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
empty=
org.junit.platform:junit-platform-commons:1.10.1=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-engine:1.10.1=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-launcher:1.10.1=devCompileClasspath,devRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit:junit-bom:5.10.1=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.opentest4j:opentest4j:1.3.0=compileClasspath,devCompileClasspath,devRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
empty=annotationProcessor,devAnnotationProcessor,sampleAnnotationProcessor,testAnnotationProcessor
18 changes: 14 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
pluginManagement {
plugins {
id("dev.clojurephant.clojure") version("0.7.0")
id("dev.clojurephant.clojure") version("0.8.0-beta.2")

id("org.ajoberstar.grgit") version("5.0.0")
id("org.ajoberstar.reckon") version("0.16.1")
id("com.diffplug.spotless") version("6.9.1")
id("org.ajoberstar.reckon.settings") version("0.18.2")
id("com.diffplug.spotless") version("6.23.3")
}
}

plugins {
id("org.ajoberstar.reckon.settings")
}

extensions.configure<org.ajoberstar.reckon.gradle.ReckonExtension> {
setDefaultInferredScope("patch")
stages("beta", "rc", "final")
setScopeCalc(calcScopeFromProp().or(calcScopeFromCommitMessages()))
setStageCalc(calcStageFromProp())
}

dependencyResolutionManagement {
repositories {
mavenCentral()
Expand Down