Skip to content

Commit cce59a8

Browse files
committed
moved mode inside its own subfolder, gradle build works
1 parent 43bfd40 commit cce59a8

File tree

580 files changed

+147
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

580 files changed

+147
-28
lines changed

build.gradle

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ allprojects {
1515

1616
ext.android_platform = "$sdkdir/platforms/android-$sdkver"
1717
ext.android_tools_lib = "$sdkdir/platforms/android-$sdkver/tools/lib"
18-
ext.core_jar_path = "$rootDir/processing-core.zip"
18+
ext.core_jar_path = "$rootDir/mode/processing-core.zip"
1919

2020
repositories {
2121
jcenter()
@@ -33,20 +33,9 @@ allprojects {
3333

3434
dependencies {
3535
compile name: 'android'
36+
compile project(":mode")
3637
compile project(":libs:core")
3738
compile project(":libs:vr")
38-
compile group: 'org.processing', name: 'core', version: '3.3.6'
39-
compile group: 'org.processing', name: 'pde', version: '3.3.6'
40-
compile group: 'org.processing', name: 'java-mode', version: '3.3.6'
41-
compile "org.gradle:gradle-tooling-api:4.2.1"
42-
}
43-
44-
sourceSets {
45-
main {
46-
java {
47-
srcDirs = ['src/']
48-
}
49-
}
5039
}
5140

5241
import java.nio.file.Files
@@ -59,21 +48,16 @@ task dist {
5948
def root = "$buildDir/zip/AndroidMode"
6049

6150
// Copy assets to build dir
62-
FileUtils.copyDirectory(file("templates"), file("$root/templates"))
63-
FileUtils.copyDirectory(file("examples"), file("$root/examples"))
64-
FileUtils.copyDirectory(file("icons"), file("$root/icons"))
65-
FileUtils.copyDirectory(file("mode"), file("$root/mode"))
66-
FileUtils.copyDirectory(file("theme"), file("$root/theme"))
67-
68-
Files.copy(file("$buildDir/libs/processing-android.jar").toPath(),
69-
file("$root/mode/AndroidMode.jar").toPath(), REPLACE_EXISTING);
70-
Files.copy(file("$buildDir/libs/processing-android.jar").toPath(),
71-
file("mode/AndroidMode.jar").toPath(), REPLACE_EXISTING);
51+
FileUtils.copyDirectory(file("mode/templates"), file("$root/templates"))
52+
FileUtils.copyDirectory(file("mode/examples"), file("$root/examples"))
53+
FileUtils.copyDirectory(file("mode/icons"), file("$root/icons"))
54+
FileUtils.copyDirectory(file("mode/mode"), file("$root/mode"))
55+
FileUtils.copyDirectory(file("mode/theme"), file("$root/theme"))
7256

7357
Files.copy(file("libs/core/build/libs/processing-core.zip").toPath(),
7458
file("$root/processing-core.zip").toPath(), REPLACE_EXISTING);
7559

76-
Files.copy(file("mode.properties").toPath(),
60+
Files.copy(file("mode/mode.properties").toPath(),
7761
file("$root/mode.properties").toPath(), REPLACE_EXISTING);
7862

7963
FileUtils.copyDirectory(file("tools/SDKUpdater/tool"),
@@ -93,7 +77,7 @@ task dist {
9377
file("$root/libs/vr/library.properties").toPath(), REPLACE_EXISTING);
9478

9579
ZipUtil.pack(file("$buildDir/zip"), new File("release/AndroidMode.zip"))
96-
Files.copy(file("mode.properties").toPath(),
80+
Files.copy(file("mode/mode.properties").toPath(),
9781
file("release/AndroidMode.txt").toPath(), REPLACE_EXISTING);
9882
} catch (Exception ex) {
9983
logger.error ex.getMessage()

libs/core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ task dist {
9191
file("$buildDir/libs/processing-core.zip").toPath(), REPLACE_EXISTING);
9292

9393
// and copy it to root
94-
Files.copy(file("$buildDir/libs/core.jar").toPath(),
95-
file("$core_jar_path").toPath(), REPLACE_EXISTING);
94+
Files.copy(file("$buildDir/libs/core.jar").toPath(),
95+
file("$core_jar_path").toPath(), REPLACE_EXISTING);
9696
}
9797
}
9898

File renamed without changes.

.project renamed to mode/.project

File renamed without changes.

mode/build.gradle

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
apply plugin: 'java'
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath group: 'commons-io', name: 'commons-io', version: '2.5'
9+
classpath group: 'org.zeroturnaround', name: 'zt-zip', version: '1.9'
10+
}
11+
}
12+
13+
dependencies {
14+
compile group: 'org.processing', name: 'core', version: '3.3.6'
15+
compile group: 'org.processing', name: 'pde', version: '3.3.6'
16+
compile group: 'org.processing', name: 'java-mode', version: '3.3.6'
17+
compile "org.gradle:gradle-tooling-api:4.2.1"
18+
}
19+
20+
sourceSets {
21+
main {
22+
java {
23+
srcDirs = ['src/']
24+
}
25+
}
26+
}
27+
28+
import java.nio.file.Files
29+
import static java.nio.file.StandardCopyOption.*;
30+
31+
task dist {
32+
doLast {
33+
Files.copy(file("$buildDir/libs/mode.jar").toPath(),
34+
file("mode/AndroidMode.jar").toPath(), REPLACE_EXISTING);
35+
}
36+
}
37+
38+
dist.dependsOn build

mode/build.xml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0"?>
2+
3+
<project name="Android Mode for Processing" default="build">
4+
5+
<!-- path to the main processing repo -->
6+
<property name="processing.dir" value="../processing" />
7+
8+
<property name="core.jar.path" value="processing-core.zip" />
9+
<property name="mode.jar.path" value="mode/AndroidMode.jar" />
10+
<property name="mode.dist.path" value="release/AndroidMode.zip" />
11+
<property name="tools.jar.path" value="mode/tools.jar" />
12+
13+
<target name="clean" depends="subprojects-clean" description="Clean the build directories">
14+
<delete dir="bin" />
15+
<delete file="${mode.jar.path}" />
16+
</target>
17+
18+
<target name="compile" depends="subprojects-build" description="Compile sources">
19+
20+
<condition property="core-built">
21+
<available file="${processing.dir}/core/library/core.jar" />
22+
</condition>
23+
<fail unless="core-built"
24+
message="Please build the core library first and make sure it sits in ${processing.dir}/core/library/core.jar" />
25+
26+
<mkdir dir="bin" />
27+
28+
<!-- env used to set classpath below -->
29+
<property environment="env" />
30+
31+
<javac source="1.7"
32+
target="1.7"
33+
destdir="bin"
34+
encoding="UTF-8"
35+
includeAntRuntime="false"
36+
classpath="${processing.dir}/core/library/core.jar;
37+
${processing.dir}/java/mode/JavaMode.jar;
38+
${processing.dir}/java/mode/org.eclipse.core.runtime.jar;
39+
${processing.dir}/app/pde.jar;
40+
mode/gradle-tooling-api-4.4.1.jar"
41+
debug="on">
42+
<src path="src" />
43+
</javac>
44+
</target>
45+
46+
47+
<target name="build" depends="compile" description="Build Android mode">
48+
<jar basedir="bin" destfile="${mode.jar.path}" />
49+
</target>
50+
51+
52+
<target name="dist" depends="build"
53+
description="Create AndroidMode.zip and AndroidMode.txt">
54+
<mkdir dir="release" />
55+
56+
<zip destfile="${mode.dist.path}">
57+
<zipfileset dir="." prefix="AndroidMode">
58+
<include name="processing-core.zip" />
59+
<include name="mode.properties" />
60+
<include name="mode/**" />
61+
<include name="templates/**" />
62+
<include name="examples/**" />
63+
<include name="icons/**" />
64+
<include name="theme/**" />
65+
<include name="tools/SDKUpdater/tool/**" />
66+
<include name="tools/SDKUpdater/src/**" />
67+
<include name="libs/vr/library.properties" />
68+
<include name="libs/vr/examples/**" />
69+
<include name="libs/vr/gvrsdk/**" />
70+
<include name="libs/vr/lib/**" />
71+
<include name="libs/vr/library/**" />
72+
<include name="libs/vr/src/**" />
73+
<exclude name="**/._*" />
74+
</zipfileset>
75+
</zip>
76+
77+
<copy file="mode.properties"
78+
tofile="release/AndroidMode.txt" />
79+
</target>
80+
81+
<!-- - - - - - - - - - - - - - - - - - -->
82+
<!-- Subprojects: libraries, tools -->
83+
<!-- - - - - - - - - - - - - - - - - - -->
84+
85+
<target name="subprojects-clean">
86+
<subant buildpath="libs/core" target="clean"/>
87+
<subant buildpath="libs/vr" target="clean"/>
88+
<subant buildpath="tools/SDKUpdater" target="clean"/>
89+
</target>
90+
91+
<target name="subprojects-build">
92+
<subant buildpath="libs/core" target="build"/>
93+
<subant buildpath="libs/vr" target="build"/>
94+
<subant buildpath="tools/SDKUpdater" target="build"/>
95+
</target>
96+
97+
</project>

0 commit comments

Comments
 (0)