Skip to content

Commit 487e51d

Browse files
committed
fix: gradle multi-project fix
1 parent 18bec32 commit 487e51d

File tree

6 files changed

+38
-16
lines changed

6 files changed

+38
-16
lines changed

kotlin/build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ buildscript {
1313
}
1414
}
1515

16+
apply plugin: "idea"
17+
apply plugin: "java"
18+
apply plugin: "kotlin"
19+
apply plugin: "application"
20+
1621
allprojects {
1722
repositories {
1823
mavenCentral()
1924
jcenter()
2025
}
2126
}
2227

23-
task clean(type: Delete) {
24-
delete rootProject.buildDir
25-
}
28+
mainClassName = "vacuumanalytics.LogEventKt"

kotlin/library/build.gradle

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@ apply plugin: "idea"
1717
apply plugin: "java"
1818
apply plugin: "kotlin"
1919
apply plugin: "application"
20-
/*
21-
sourceSets {
22-
main.java.srcDirs += ''
23-
}*/
2420

25-
mainClassName = "LogEvent"
21+
mainClassName = "vacuumanalytics.LogEventKt"
2622

2723
repositories {
2824
mavenCentral()
@@ -36,10 +32,26 @@ dependencies {
3632
compile 'com.github.kittinunf.fuel:fuel:1.11.0'
3733
}
3834

35+
repositories {
36+
mavenCentral()
37+
jcenter()
38+
flatDir {
39+
dirs 'libs'
40+
}
41+
}
42+
43+
// Include dependent libraries in archive.
3944
jar {
4045
manifest {
41-
attributes "Main-Class": "vacuumanalytics.$mainClassName"
46+
attributes "Main-Class": "$mainClassName"
47+
}
48+
from {
49+
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
50+
} {
51+
exclude "META-INF/*.SF"
52+
exclude "META-INF/*.DSA"
53+
exclude "META-INF/*.RSA"
4254
}
4355

44-
baseName 'vacuum-analytics'
56+
baseName 'library'
4557
}
File renamed without changes.

kotlin/sample/build.gradle

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ buildscript {
1313
}
1414
}
1515

16+
apply plugin: "idea"
1617
apply plugin: "java"
1718
apply plugin: "kotlin"
19+
apply plugin: "application"
20+
1821
sourceSets {
1922
main.java.srcDirs += 'src/main/'
2023
}
@@ -30,16 +33,20 @@ dependencies {
3033
/*compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"*/
3134
}
3235

33-
compileKotlin {
34-
kotlinOptions.jvmTarget = "1.8"
35-
}
36+
mainClassName = "sample.MainKt"
3637

3738
jar {
3839
manifest {
39-
attributes "Main-Class": "sample.MainKt"
40+
attributes "Main-Class": "$mainClassName"
4041
}
4142

42-
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
43+
from {
44+
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
45+
} {
46+
exclude "META-INF/*.SF"
47+
exclude "META-INF/*.DSA"
48+
exclude "META-INF/*.RSA"
49+
}
4350

4451
baseName 'sample'
4552
}
File renamed without changes.

kotlin/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ':library', ':sample'
1+
include 'library', 'sample'

0 commit comments

Comments
 (0)