File tree Expand file tree Collapse file tree 9 files changed +18
-16
lines changed
bulk-model-sync-gradle-test Expand file tree Collapse file tree 9 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ subprojects {
101
101
reports {
102
102
sarif.required.set(true )
103
103
// This is required for the GitHub upload action to easily find all sarif files in a single directory.
104
- sarif.outputLocation.set(parentProject.buildDir.resolve (" reports/detekt/${project.name} .sarif" ))
104
+ sarif.outputLocation.set(parentProject.layout.buildDirectory.file (" reports/detekt/${project.name} .sarif" ))
105
105
html.required.set(true )
106
106
}
107
107
}
@@ -237,7 +237,7 @@ fun MavenPublication.setMetadata() {
237
237
tasks.withType< org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask > {
238
238
dependsOn(" :ts-model-api:npm_run_build" )
239
239
}
240
- val docsDir = buildDir.resolve (" dokka" )
240
+ val docsDir = project.layout.buildDirectory.dir (" dokka" ).get().asFile
241
241
242
242
tasks.dokkaHtmlMultiModule {
243
243
outputDirectory.set(docsDir.resolve(" $version " ))
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ repositories {
42
42
}
43
43
44
44
val mps by configurations.creating
45
- val mpsDir = buildDir.resolve (" mps" ).apply { mkdirs() }
46
- val kotlinGenDir = buildDir.resolve (" metamodel/kotlin" ).apply { mkdirs() }
45
+ val mpsDir = project.layout.buildDirectory.dir (" mps" ).get().asFile .apply { mkdirs() }
46
+ val kotlinGenDir = project.layout.buildDirectory.dir (" metamodel/kotlin" ).get().asFile .apply { mkdirs() }
47
47
48
48
dependencies {
49
49
mps(" com.jetbrains:mps:2021.2.5" )
@@ -82,7 +82,7 @@ val resolveMps by tasks.registering(Copy::class) {
82
82
into(mpsDir)
83
83
}
84
84
85
- val repoDir = buildDir.resolve (" test-repo" )
85
+ val repoDir = project.layout.buildDirectory.dir (" test-repo" ).get().asFile
86
86
87
87
val copyTestRepo by tasks.registering(Sync ::class ) {
88
88
from(projectDir.resolve(" test-repo" ))
Original file line number Diff line number Diff line change @@ -16,14 +16,14 @@ val modelixCoreVersion = file("../../version.txt").readText()
16
16
version = modelixCoreVersion
17
17
18
18
val mps: Configuration by configurations.creating
19
- val kotlinGenDir = buildDir.resolve (" metamodel/kotlin" ).apply { mkdirs() }
19
+ val kotlinGenDir = project.layout.buildDirectory.dir (" metamodel/kotlin" ).get().asFile .apply { mkdirs() }
20
20
21
21
dependencies {
22
22
mps(" com.jetbrains:mps:2021.2.5" )
23
23
api(" org.modelix:model-api-gen-runtime:$modelixCoreVersion " )
24
24
}
25
25
26
- val mpsDir = buildDir.resolve (" mps" ).apply { mkdirs() }
26
+ val mpsDir = project.layout.buildDirectory.dir (" mps" ).get().asFile .apply { mkdirs() }
27
27
28
28
val resolveMps by tasks.registering(Copy ::class ) {
29
29
from(mps.resolve().map { zipTree(it) })
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ description = "API to access models stored in Modelix"
9
9
ktlint {
10
10
filter {
11
11
exclude {
12
- it.file.toPath().toAbsolutePath().startsWith(project(" :ts-model-api" ).buildDir.toPath().toAbsolutePath())
12
+ val kotlinGeneratedFromTypeScript =
13
+ project(" :ts-model-api" ).layout.buildDirectory.get().asFile.toPath().toAbsolutePath()
14
+ it.file.toPath().toAbsolutePath().startsWith(kotlinGeneratedFromTypeScript)
13
15
}
14
16
}
15
17
}
Original file line number Diff line number Diff line change @@ -95,9 +95,9 @@ kotlin {
95
95
}
96
96
97
97
tasks.jacocoTestReport {
98
- classDirectories.setFrom(" $buildDir / classes/kotlin/jvm/" )
98
+ classDirectories.setFrom(project.layout.buildDirectory.dir( " classes/kotlin/jvm/" ) )
99
99
sourceDirectories.setFrom(files(" src/commonMain/kotlin" , " src/jvmMain/kotlin" ))
100
- executionData.setFrom(files( " $buildDir / jacoco/jvmTest.exec" ))
100
+ executionData.setFrom(project.layout.buildDirectory.file( " jacoco/jvmTest.exec" ))
101
101
102
102
reports {
103
103
xml.required.set(true )
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ tasks.named<ShadowJar>("shadowJar") {
92
92
}
93
93
}
94
94
95
- val fatJarFile = file(" $buildDir / libs/model-server-latest-fatJar.jar" )
95
+ val fatJarFile = project.layout.buildDirectory. file(" libs/model-server-latest-fatJar.jar" )
96
96
val fatJarArtifact = artifacts.add(" archives" , fatJarFile) {
97
97
type = " jar"
98
98
builtBy(" shadowJar" )
@@ -116,7 +116,7 @@ tasks.named("build") {
116
116
}
117
117
118
118
task(" copyLibs" , Sync ::class ) {
119
- into(" $buildDir / dependency-libs" )
119
+ into(project.layout.buildDirectory.dir( " dependency-libs" ) )
120
120
from(configurations.runtimeClasspath)
121
121
}
122
122
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ kotlin {
42
42
implementation(libs.kotlin.serialization.json)
43
43
api(libs.kotlin.coroutines.core)
44
44
}
45
- kotlin.srcDir(buildDir.resolve (" version_gen" ))
45
+ kotlin.srcDir(project.layout.buildDirectory.dir (" version_gen" ))
46
46
}
47
47
val commonTest by getting {
48
48
dependencies {
@@ -71,7 +71,7 @@ kotlin {
71
71
72
72
val generateVersionVariable by tasks.creating {
73
73
doLast {
74
- val outputDir = buildDir.resolve (" version_gen/org/modelix/modelql/core" )
74
+ val outputDir = project.layout.buildDirectory.dir (" version_gen/org/modelix/modelql/core" ).get().asFile
75
75
outputDir.mkdirs()
76
76
outputDir.resolve(" Version.kt" ).writeText(
77
77
"""
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ tasks {
87
87
if (mpsPluginDir != null && mpsPluginDir.isDirectory) {
88
88
create<Sync >(" installMpsPlugin" ) {
89
89
dependsOn(prepareSandbox)
90
- from(buildDir.resolve (" idea-sandbox/plugins/mps-model-server-plugin" ))
90
+ from(project.layout.buildDirectory.dir (" idea-sandbox/plugins/mps-model-server-plugin" ))
91
91
into(mpsPluginDir.resolve(" mps-model-server-plugin" ))
92
92
}
93
93
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ val patchKotlinExternals = tasks.create("patchKotlinExternals") {
18
18
dependsOn(" npm_run_generateKotlin" )
19
19
doLast {
20
20
val annotationLine = """ @file:JsModule("@modelix/ts-model-api") @file:JsNonModule"""
21
- val dukatDir = buildDir.resolve (" dukat" )
21
+ val dukatDir = project.layout.buildDirectory.dir (" dukat" ).get().asFile
22
22
val files = dukatDir.listFiles()?.toList() ? : emptyList()
23
23
val matchingFiles = files.filter { it.name.contains(" @modelix_ts-model-api" ) }
24
24
if (matchingFiles.isEmpty()) throw RuntimeException (" No files found for patching in $dukatDir " )
You can’t perform that action at this time.
0 commit comments