Skip to content

Commit 95aeb26

Browse files
committed
Improvements for build files.
Signed-off-by: Marcin Kuszczak <1508798+aartiPl@users.noreply.github.com>
1 parent 8b7f441 commit 95aeb26

2 files changed

Lines changed: 26 additions & 21 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@ jobs:
6464
6565
echo "OsType: $OSTYPE"
6666
67-
gradle clean assemble test || { echo 'Compilation or Unit tests failed' ; exit 1; }
67+
./gradlew clean assemble test || { echo 'Compilation or Unit tests failed' ; exit 1; }
6868
6969
if [[ "$OSTYPE" == "linux"* ]]; then
7070
echo "Linux test..."
71-
gradle -DosType=$OSTYPE -DincludeTags='posix | linux' integration
71+
./gradlew -DosType=$OSTYPE -DincludeTags='posix | linux' integration
7272
elif [[ "$OSTYPE" == "darwin"* ]]; then
7373
echo "MacOs test..."
74-
gradle -DosType=$OSTYPE -DincludeTags='posix | macos' integration
74+
./gradlew -DosType=$OSTYPE -DincludeTags='posix | macos' integration
7575
elif [[ "$OSTYPE" == "cygwin" ]]; then
7676
echo "Cygwin test..."
77-
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integration
77+
./gradlew -DosType=$OSTYPE -DincludeTags='posix | cygwin' integration
7878
elif [[ "$OSTYPE" == "msys" ]]; then
7979
echo "MSys test..."
80-
gradle -DosType=$OSTYPE -DincludeTags='posix | msys' integration
80+
./gradlew -DosType=$OSTYPE -DincludeTags='posix | msys' integration
8181
elif [[ "$OSTYPE" == "freebsd"* ]]; then
8282
echo "FreeBsd test..."
83-
gradle -DosType=$OSTYPE -DincludeTags='posix' integration
83+
./gradlew -DosType=$OSTYPE -DincludeTags='posix' integration
8484
else
8585
echo "Unknown OS"
8686
exit 1
@@ -91,9 +91,9 @@ jobs:
9191
shell: cmd
9292
run: |
9393
echo "Windows test..."
94-
gradle clean assemble test
94+
.\gradlew.bat clean assemble test
9595
if %errorlevel% neq 0 exit /b %errorlevel%
96-
gradle -DosType=windows -DincludeTags="windows" integration
96+
.\gradlew.bat -DosType=windows -DincludeTags="windows" integration
9797
9898
- name: Install Cygwin (only Windows)
9999
if: matrix.variant == 'cygwin'
@@ -107,5 +107,5 @@ jobs:
107107
echo "Cygwin test..."
108108
echo "Changing directory to $GITHUB_WORKSPACE ..."
109109
cd $GITHUB_WORKSPACE
110-
gradle clean assemble test || { echo 'Compilation or Unit tests failed' ; exit 1; }
111-
gradle -DosType=$OSTYPE -DincludeTags='posix | cygwin' integration
110+
./gradlew clean assemble test || { echo 'Compilation or Unit tests failed' ; exit 1; }
111+
./gradlew -DosType=$OSTYPE -DincludeTags='posix | cygwin' integration

build.gradle.kts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ plugins {
1313
id("com.github.johnrengelman.shadow") version "7.1.2"
1414
`maven-publish`
1515
signing
16+
idea
1617
}
1718

1819
repositories {
@@ -35,21 +36,19 @@ buildConfig {
3536

3637
buildConfigField("String", "APP_NAME", "\"${project.name}\"")
3738
buildConfigField("String", "APP_VERSION", provider { "\"${project.version}\"" })
38-
buildConfigField("java.time.ZonedDateTime", "APP_BUILD_TIME", provider { "java.time.ZonedDateTime.parse(\"$dateTime\")" })
39+
buildConfigField("java.time.ZonedDateTime",
40+
"APP_BUILD_TIME",
41+
provider { "java.time.ZonedDateTime.parse(\"$dateTime\")" })
3942
buildConfigField("String", "KOTLIN_VERSION", provider { "\"${kotlinVersion}\"" })
4043
}
4144

4245
sourceSets {
4346
create("integration") {
44-
// test { //With that idea can understand that 'integration' is a test source set and do not complain about test
45-
// names starting with upper case, but it doesn't compile correctly with it
46-
java {
47-
srcDir("$projectDir/src/integration/kotlin")
48-
}
47+
kotlin.srcDir("$projectDir/src/integration/kotlin")
4948
resources.srcDir("$projectDir/src/integration/resources")
49+
5050
compileClasspath += main.get().output + test.get().output
5151
runtimeClasspath += main.get().output + test.get().output
52-
// }
5352
}
5453
}
5554

@@ -63,6 +62,13 @@ configurations {
6362
get("integrationRuntimeOnly").extendsFrom(get("testRuntimeOnly"))
6463
}
6564

65+
idea {
66+
module {
67+
@Suppress("UnstableApiUsage")
68+
testSources.from(sourceSets["integration"].kotlin.srcDirs)
69+
}
70+
}
71+
6672
java {
6773
toolchain {
6874
languageVersion.set(JavaLanguageVersion.of(8))
@@ -78,7 +84,7 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
7884
}
7985
}
8086

81-
tasks.create<Test>("integration") {
87+
tasks.create<Test>("integrationTest") {
8288
val itags = System.getProperty("includeTags") ?: ""
8389
val etags = System.getProperty("excludeTags") ?: ""
8490

@@ -101,7 +107,7 @@ tasks.create<Test>("integration") {
101107
testClassesDirs = sourceSets["integration"].output.classesDirs
102108
classpath = sourceSets["integration"].runtimeClasspath
103109
outputs.upToDateWhen { false }
104-
mustRunAfter(tasks["test"])
110+
//mustRunAfter(tasks["test"])
105111
//dependsOn(tasks["assemble"], tasks["test"])
106112

107113
doLast {
@@ -205,8 +211,7 @@ application {
205211
mainClass.set(project.group.toString() + ".KscriptKt")
206212
}
207213

208-
val jar: Task by tasks.getting {
209-
}
214+
val jar: Task by tasks.getting {}
210215

211216
val shadowDistTar: Task by tasks.getting {
212217
enabled = false

0 commit comments

Comments
 (0)