blob: 95a910548255731bea1695e6c39a34b101954ea0 [file] [log] [blame]
Morten Krogh-Jespersen81c34082023-06-22 15:37:41 +02001// Copyright (c) 2023, the R8 project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5import org.gradle.api.JavaVersion
6import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
7
8plugins {
9 `kotlin-dsl`
10 `java-library`
11 id("dependencies-plugin")
12}
13
14val root = getRoot()
15
16java {
17 sourceSets.test.configure {
18 java.srcDirs.clear()
19 java.srcDir(root.resolveAll("src", "test", "examples"))
20 }
21 sourceCompatibility = JavaVersion.VERSION_1_8
22 targetCompatibility = JavaVersion.VERSION_1_8
23}
24
25dependencies {
26 testCompileOnly(Deps.mockito)
27}
28
Morten Krogh-Jespersen836cf302023-08-07 14:06:10 +020029val thirdPartyCompileDependenciesTask = ensureThirdPartyDependencies(
30 "compileDeps",
31 listOf(Jdk.JDK_11.getThirdPartyDependency()))
32
Morten Krogh-Jespersen81c34082023-06-22 15:37:41 +020033tasks {
Morten Krogh-Jespersenb823d0b2023-08-07 14:06:49 +020034 compileTestJava {
35 options.compilerArgs = listOf("-g:source,lines")
36 }
37
38 register<JavaCompile>("debuginfo-all") {
39 source = sourceSets.test.get().allSource
40 include("**/*.java")
41 classpath = sourceSets.test.get().compileClasspath
42 destinationDirectory.set(getRoot().resolveAll("build","test","examples","classes_debuginfo_all"))
43 options.compilerArgs = listOf("-g")
44 }
45
46 register<JavaCompile>("debuginfo-none") {
47 source = sourceSets.test.get().allSource
48 include("**/*.java")
49 classpath = sourceSets.test.get().compileClasspath
50 destinationDirectory.set(getRoot().resolveAll("build","test","examples","classes_debuginfo_none"))
51 options.compilerArgs = listOf("-g:none")
Morten Krogh-Jespersen81c34082023-06-22 15:37:41 +020052 }
53}
Morten Krogh-Jespersenb823d0b2023-08-07 14:06:49 +020054
55// We just need to register the examples jars for it to be referenced by other modules. This should
56// be placed after all task registrations.
57val buildExampleJars = buildExampleJars("examples")