Skip to content

Commit 68c98e8

Browse files
committed
Sync gradle scripts between projects
1 parent 72bac75 commit 68c98e8

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

buildSrc/src/main/groovy/base.base-conventions.gradle

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ repositories {
1111
}
1212

1313
jar {
14-
var projectName = project.name
15-
from("LICENSE") {
16-
rename { "${it}_${projectName}" }
14+
if (layout.projectDirectory.file("LICENSE").asFile.exists()) {
15+
def projectName = project.name
16+
from(layout.projectDirectory.file("LICENSE")) {
17+
rename { "${it}_${projectName}" }
18+
}
19+
} else if (rootProject.layout.projectDirectory.file("LICENSE").asFile.exists()) {
20+
def projectName = rootProject.name
21+
from(rootProject.layout.projectDirectory.file("LICENSE")) {
22+
rename { "${it}_${projectName}" }
23+
}
1724
}
1825
}
1926

buildSrc/src/main/groovy/base.exclude-run-folder.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
idea {
66
module {
77
["run"].each {
8-
excludeDirs << file("$it")
8+
excludeDirs << layout.projectDirectory.file("$it").asFile
99
}
1010
}
1111
}

buildSrc/src/main/groovy/base.include-configuration.gradle renamed to buildSrc/src/main/groovy/base.include-in-jar-configuration.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
configurations {
2-
include
2+
includeInJar
33

4-
implementation.extendsFrom(include)
5-
api.extendsFrom(include)
4+
implementation.extendsFrom(includeInJar)
5+
api.extendsFrom(includeInJar)
66
}
77

88
jar {
9-
dependsOn(configurations.include)
9+
dependsOn(configurations.includeInJar)
1010
from {
1111
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
12-
configurations.include.collect {
12+
configurations.includeInJar.collect {
1313
zipTree(it)
1414
}
1515
} {

buildSrc/src/main/groovy/viaproxy.plugin-conventions.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id "java-library"
33
id "base.base-conventions"
4-
id "base.include-configuration"
4+
id "base.include-in-jar-configuration"
55
id "viaproxy.run-with-viaproxy-task"
66
}
77

0 commit comments

Comments
 (0)