-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework logger, Warn on missing stubs
- Loading branch information
1 parent
12a317d
commit 3514037
Showing
20 changed files
with
664 additions
and
229 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
56 changes: 56 additions & 0 deletions
56
buildSrc/src/main/kotlin/xyz/wagyourtail/gradle/coverage/CoverageRunTask.kt
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,56 @@ | ||
package xyz.wagyourtail.gradle.coverage | ||
|
||
import org.gradle.api.JavaVersion | ||
import org.gradle.api.file.FileCollection | ||
import org.gradle.api.file.RegularFileProperty | ||
import org.gradle.api.internal.ConventionTask | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.* | ||
import org.gradle.jvm.toolchain.JavaLanguageVersion | ||
import org.gradle.jvm.toolchain.JavaToolchainService | ||
|
||
abstract class CoverageRunTask : ConventionTask() { | ||
|
||
@get:InputFile | ||
abstract val apiJar: RegularFileProperty | ||
|
||
@get:Internal | ||
abstract var classpath: FileCollection | ||
|
||
@get:InputFile | ||
abstract val ctSym: RegularFileProperty | ||
|
||
@get:Input | ||
abstract val javaVersion: Property<JavaVersion> | ||
|
||
@get:OutputDirectory | ||
@get:Optional | ||
abstract var coverageReports: FileCollection | ||
|
||
|
||
init { | ||
group = "jvmdg" | ||
coverageReports = project.files(temporaryDir.resolve("coverage")) | ||
} | ||
|
||
@TaskAction | ||
fun run() { | ||
val toolchains = project.extensions.getByType(JavaToolchainService::class.java) | ||
|
||
project.javaexec { spec -> | ||
spec.executable = toolchains.launcherFor { | ||
it.languageVersion.set(JavaLanguageVersion.of(javaVersion.get().majorVersion)) | ||
}.get().executablePath.asFile.absolutePath | ||
|
||
spec.workingDir = temporaryDir | ||
spec.mainClass.set("xyz.wagyourtail.jvmdg.coverage.ApiCoverageChecker") | ||
spec.classpath = classpath | ||
spec.jvmArgs("-Djvmdg.java-api=${apiJar.get().asFile.absolutePath}", "-Djvmdg.quiet=true") | ||
spec.args(ctSym.get().asFile.absolutePath) | ||
|
||
}.assertNormalExitValue().rethrowFailure() | ||
|
||
} | ||
|
||
|
||
} |
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
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
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
Oops, something went wrong.