mirror of
https://github.com/tadfisher/gradle2nix.git
synced 2026-01-12 07:50:53 -05:00
Rewrite based on code from the GitHub Dependency Graph Gradle Plugin
This commit is contained in:
@@ -1,52 +1,29 @@
|
||||
buildscript {
|
||||
configurations.classpath {
|
||||
resolutionStrategy.activateDependencyLocking()
|
||||
}
|
||||
}
|
||||
import com.github.jengelman.gradle.plugins.shadow.relocation.SimpleRelocator
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.utils.extendsFrom
|
||||
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
id("org.jetbrains.kotlin.jvm")
|
||||
id("com.gradle.plugin-publish")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
id("org.ajoberstar.stutter")
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
test {
|
||||
java.srcDir("src/test/kotlin")
|
||||
}
|
||||
}
|
||||
|
||||
dependencyLocking {
|
||||
lockAllConfigurations()
|
||||
}
|
||||
|
||||
configurations {
|
||||
compile {
|
||||
dependencies.remove(project.dependencies.gradleApi())
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
|
||||
implementation("org.apache.maven:maven-repository-metadata:latest.release")
|
||||
implementation(project(":ivy"))
|
||||
compileOnly(kotlin("stdlib-jdk8"))
|
||||
compileOnly(kotlin("reflect"))
|
||||
implementation(project(":model"))
|
||||
shadow(gradleApi())
|
||||
implementation(libs.serialization.json)
|
||||
}
|
||||
|
||||
compatTestImplementation("com.adobe.testing:s3mock-junit5:latest.release")
|
||||
compatTestImplementation("com.squareup.okio:okio:latest.release")
|
||||
compatTestImplementation("dev.minutest:minutest:latest.release")
|
||||
compatTestImplementation("io.javalin:javalin:latest.release")
|
||||
compatTestImplementation("io.strikt:strikt-core:latest.release")
|
||||
compatTestImplementation("org.junit.jupiter:junit-jupiter-api:latest.release")
|
||||
compatTestImplementation("org.junit.jupiter:junit-jupiter-params:latest.release")
|
||||
compatTestImplementation(embeddedKotlin("reflect"))
|
||||
compatTestImplementation(embeddedKotlin("stdlib-jdk8"))
|
||||
compatTestImplementation(embeddedKotlin("test-junit5"))
|
||||
compatTestImplementation(gradleTestKit())
|
||||
compatTestImplementation(project(":model"))
|
||||
compatTestRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
|
||||
compatTestRuntimeOnly("org.junit.platform:junit-platform-launcher:latest.release")
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.JVM_1_8)
|
||||
}
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
@@ -60,35 +37,25 @@ gradlePlugin {
|
||||
}
|
||||
}
|
||||
|
||||
kotlinDslPluginOptions {
|
||||
experimentalWarning.set(false)
|
||||
}
|
||||
|
||||
stutter {
|
||||
isSparse = true
|
||||
java(8) {
|
||||
compatibleRange("4.4")
|
||||
}
|
||||
java(11) {
|
||||
compatibleRange("5.0")
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
pluginUnderTestMetadata {
|
||||
pluginClasspath.setFrom(files(shadowJar))
|
||||
jar {
|
||||
manifest {
|
||||
attributes["Implementation-Version"] = archiveVersion.get()
|
||||
attributes["Implementation-Title"] = "Gradle2Nix Plugin"
|
||||
attributes["Implementation-Vendor"] = "Tad Fisher"
|
||||
}
|
||||
}
|
||||
|
||||
withType<Test> {
|
||||
useJUnitPlatform {
|
||||
includeEngines("junit-jupiter")
|
||||
}
|
||||
shadowJar {
|
||||
archiveClassifier.set("")
|
||||
relocate("kotlin", "${project.group}.shadow.kotlin")
|
||||
relocate("kotlinx.serialization", "${project.group}.shadow.serialization")
|
||||
relocate("net.swiftzer.semver", "${project.group}.shadow.semver")
|
||||
relocate("org.intellij", "${project.group}.shadow.intellij")
|
||||
relocate("org.jetbrains", "${project.group}.shadow.jetbrains")
|
||||
}
|
||||
|
||||
// Default logging config exposes a classpath conflict between
|
||||
// the Gradle API and SFL4J.
|
||||
// (Sprint Boot is used in S3Mock)
|
||||
systemProperty("org.springframework.boot.logging.LoggingSystem", "org.springframework.boot.logging.java.JavaLoggingSystem")
|
||||
|
||||
systemProperty("fixtures", "$rootDir/fixtures")
|
||||
validatePlugins {
|
||||
enableStricterValidation.set(true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user