forked from konrad-jamrozik/droidmate
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsettings.gradle
67 lines (56 loc) · 2.88 KB
/
settings.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import java.nio.file.Paths
pluginManagement { // this seams essential to make simultaneous includes of android and jvm modules possible without IntelliJ/gradle to die
repositories {
gradlePluginPortal()
google()
}
resolutionStrategy {
eachPlugin {
switch(requested.id.id) {
case "kotlin-platform-common" :
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
break
case "kotlin-platform-android" :
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
break
case "com.android.library" :
useModule("com.android.tools.build:gradle:${requested.version}")
break
}
}
}
}
rootProject.name = 'droidmate-2'
// right now this is probably not even necessary due to our strange deploy hacks in core/deviceControlDaemon.gradle
include("project:deviceComponents") // to include the build of the android modules (this probably requires a dependency to the library publish task before 'DeviceControlDaemon' can be compiled)
// for proper android code highlighting we have to update the settings file (i.e. from deviceControlDaemon) via attach gradle project or open it as its own project
include(
"project:pcComponents", // use this to identify all child projects
"project:pcComponents:core",
"project:pcComponents:exploration"
// ,":deviceControlDaemon" // not working Failed to apply plugin [id 'com.android.application']
)
def isIncludedBuild = gradle.parent != null
if(!isIncludedBuild) {
def libDir = 'project/deviceCommonLib/deviceDaemonLib'
if(file("$libDir/build.gradle").exists() || file("$libDir/build.gradle.kts").exists()){
include(":deviceDaemonLib")
// we use this instead of includeBuild as android gradle does not yet support nested composite and the highlighting would be screwed up anyway
project(':deviceDaemonLib').projectDir = new File(libDir)
}
def eModelDir = 'project/pcComponents/explorationModel'
if(file("$eModelDir/build.gradle.kts").exists()){
include(":explorationModel")
project(':explorationModel').projectDir = new File(eModelDir)
}
}
/** REMARKS for later reference: */
//def isIncludedBuild = gradle.parent != null
//if(!isIncludedBuild) { // nested includes (not for android) are supported since gradle 4.10+
// we can use this instead of multi-project include as soon as we publish the artifact separately, such that the CI server can use it as external dependency
// includeBuild('project/deviceCommonLib/deviceDaemonLib')
// as long as nested includes are not supported for android we cannot do this or it would screw up IntelliJ dependency resolving when it uses 'include' to access the shared device library
// includeBuild ('project/deviceComponents/deviceControlDaemon')
// !!!//includeBuild('project/deviceComponents') // to include the build of the android modules (this probably requires a dependency to the library publish task)
//=> NOPE destroys dependencies as well
//}