@@ -2,91 +2,44 @@ apply plugin: 'java'
2
2
3
3
buildscript {
4
4
repositories {
5
+ google()
5
6
jcenter()
6
7
}
7
8
dependencies {
8
- classpath group : ' commons-io' , name : ' commons-io' , version : ' 2.5'
9
- classpath group : ' org.zeroturnaround' , name : ' zt-zip' , version : ' 1.9'
9
+ classpath ' com.android.tools.build:gradle:3.0.1'
10
10
}
11
11
}
12
12
13
13
allprojects {
14
- apply plugin : ' java'
14
+ Properties modeProperties = new Properties ()
15
+ modeProperties. load(project. rootProject. file(' mode/mode.properties' ). newDataInputStream())
16
+ ext. modeVersion = modeProperties. getProperty(' prettyVersion' )
17
+
18
+ Properties vrProperties = new Properties ()
19
+ vrProperties. load(project. rootProject. file(' mode/libraries/vr/library.properties' ). newDataInputStream())
20
+ ext. vrVersion = vrProperties. getProperty(' prettyVersion' )
21
+
22
+ def targetSdkVersion = 26
23
+ Properties localProperties = new Properties ()
24
+ localProperties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
25
+ def sdkDir = localProperties. getProperty(' sdk.dir' )
26
+ ext. androidPlatformPath = " ${ sdkDir} /platforms/android-${ targetSdkVersion} "
27
+ ext. androidToolsLibPath = " ${ sdkDir} /tools/lib"
28
+
29
+ ext. coreZipPath = " $rootDir /mode/processing-core.zip"
15
30
16
- ext. android_platform = " $sdkdir /platforms/android-$sdkver "
17
- ext. android_tools_lib = " $sdkdir /tools/lib"
18
- ext. core_jar_path = " $rootDir /mode/processing-core.zip"
19
-
20
31
repositories {
32
+ google()
21
33
jcenter()
22
- flatDir dirs : " $rootDir /core/library"
23
- flatDir dirs : " $rootDir /core/build/libs"
24
- flatDir dirs : " $rootDir /mode/libraries/vr/library"
25
- flatDir dirs : android_platform
26
- flatDir dirs : android_tools_lib
34
+ flatDir dirs : androidPlatformPath
35
+ flatDir dirs : androidToolsLibPath
36
+ flatDir dirs : " $rootDir /core/dist"
27
37
}
28
38
29
39
sourceCompatibility = 1.7
30
- targetCompatibility = 1.7
31
- }
32
-
33
- dependencies {
34
- compile name : ' android'
35
- compile project(" :core" )
36
- compile project(" :mode:libraries:vr" )
37
- compile project(" :mode" )
40
+ targetCompatibility = 1.7
38
41
}
39
42
40
-
41
43
clean. doFirst {
42
44
delete " dist"
43
45
}
44
-
45
- import java.nio.file.Files
46
- import org.zeroturnaround.zip.ZipUtil
47
- import org.apache.commons.io.FileUtils
48
- import static java.nio.file.StandardCopyOption.*;
49
-
50
- task dist {
51
- dependsOn subprojects. build
52
- doLast {
53
- def root = " $buildDir /zip/AndroidMode"
54
-
55
- // Copy assets to build dir
56
- FileUtils . copyDirectory(file(" mode/templates" ), file(" $root /templates" ))
57
- FileUtils . copyDirectory(file(" mode/examples" ), file(" $root /examples" ))
58
- FileUtils . copyDirectory(file(" mode/icons" ), file(" $root /icons" ))
59
- FileUtils . copyDirectory(file(" mode/mode" ), file(" $root /mode" ))
60
- FileUtils . copyDirectory(file(" mode/theme" ), file(" $root /theme" ))
61
-
62
- Files . copy(file(" core/build/libs/processing-core.zip" ). toPath(),
63
- file(" $root /processing-core.zip" ). toPath(), REPLACE_EXISTING );
64
-
65
- Files . copy(file(" mode/mode.properties" ). toPath(),
66
- file(" $root /mode.properties" ). toPath(), REPLACE_EXISTING );
67
-
68
- FileUtils . copyDirectory(file(" mode/tools/SDKUpdater/tool" ),
69
- file(" $root /tools/SDKUpdater/tool" ))
70
- FileUtils . copyDirectory(file(" mode/tools/SDKUpdater/src" ),
71
- file(" $root /tools/SDKUpdater/src" ))
72
-
73
- FileUtils . copyDirectory(file(" mode/libraries/vr/examples" ),
74
- file(" $root /libraries/vr/examples" ))
75
- FileUtils . copyDirectory(file(" mode/libraries/vr/gvrsdk" ),
76
- file(" $root /libraries/vr/gvrsdk" ))
77
- FileUtils . copyDirectory(file(" mode/libraries/vr/library" ),
78
- file(" $root /libraries/vr/library" ))
79
- FileUtils . copyDirectory(file(" mode/libraries/vr/src" ),
80
- file(" $root /libraries/vr/src" ))
81
- Files . copy(file(" mode/libraries/vr/library.properties" ). toPath(),
82
- file(" $root /libraries/vr/library.properties" ). toPath(), REPLACE_EXISTING );
83
-
84
- File distFolder = file(" dist" );
85
- // create intermediate folder if they don't exist
86
- distFolder. mkdirs();
87
- ZipUtil . pack(file(" $buildDir /zip" ), new File (" dist/AndroidMode.zip" ));
88
- Files . copy(file(" mode/mode.properties" ). toPath(),
89
- file(" dist/AndroidMode.txt" ). toPath(), REPLACE_EXISTING );
90
- }
91
- }
92
-
0 commit comments