Permalink
Browse files

updated ant/gradle build scripts

  • Loading branch information...
1 parent 92c5fc8 commit 89d35caa28794509bc7cf01fc3b4a62289967fdf @codeanticode codeanticode committed Jan 4, 2017
Showing with 33 additions and 112 deletions.
  1. +22 −8 build.gradle
  2. +6 −1 build.xml
  3. +1 −19 core/build.gradle
  4. +4 −26 libraries/cardboard/build.gradle
  5. +0 −58 libraries/cardboard/build.xml
View
@@ -1,26 +1,27 @@
+apply plugin: 'java'
+
buildscript {
repositories {
- //mavenCentral()
jcenter()
}
-
dependencies {
classpath group: 'commons-io', name: 'commons-io', version: '2.5'
classpath group: 'org.zeroturnaround', name: 'zt-zip', version: '1.9'
}
}
-apply plugin: 'java'
-
allprojects {
apply plugin: 'java'
- // Find location of android jar relative to ANDROID_HOME
+
ext.android_platform = "$sdkdir/platforms/android-$sdkver"
+ ext.core_jar_path = "$rootDir/android-core.zip"
repositories {
jcenter()
- //mavenCentral()
- flatDir { dirs 'core/library', android_platform}
+ flatDir dirs: "$rootDir/core/library"
+ flatDir dirs: "$rootDir/core/build/libs"
+ flatDir dirs: "$rootDir/libraries/cardboard/lib"
+ flatDir dirs: android_platform
}
sourceCompatibility = 1.7
@@ -70,10 +71,23 @@ task dist {
Files.copy(file("mode.properties").toPath(),
file("$root/mode.properties").toPath(), REPLACE_EXISTING);
+
+ FileUtils.copyDirectory(file("libraries/cardboard/examples"),
+ file("$root/libraries/cardboard/examples"))
+ FileUtils.copyDirectory(file("libraries/cardboard/gvrsdk"),
+ file("$root/libraries/cardboard/gvrsdk"))
+ FileUtils.copyDirectory(file("libraries/cardboard/lib"),
+ file("$root/libraries/cardboard/lib"))
+ FileUtils.copyDirectory(file("libraries/cardboard/library"),
+ file("$root/libraries/cardboard/library"))
+ FileUtils.copyDirectory(file("libraries/cardboard/src"),
+ file("$root/libraries/cardboard/src"))
+ Files.copy(file("libraries/cardboard/library.properties").toPath(),
+ file("$root/libraries/cardboard/library.properties").toPath(), REPLACE_EXISTING);
ZipUtil.pack(file("$buildDir/zip"), new File("release/AndroidMode.zip"))
Files.copy(file("mode.properties").toPath(),
- file("release/AndroidMode.txt").toPath(), REPLACE_EXISTING);
+ file("release/AndroidMode.txt").toPath(), REPLACE_EXISTING);
} catch (Exception ex) {
logger.error ex.getMessage()
}
View
@@ -90,7 +90,12 @@
<include name="examples/**" />
<include name="icons/**" />
<include name="theme/**" />
- <include name="libraries/**" />
+ <include name="libraries/cardboard/library.properties" />
+ <include name="libraries/cardboard/examples/**" />
+ <include name="libraries/cardboard/gvrsdk/**" />
+ <include name="libraries/cardboard/lib/**" />
+ <include name="libraries/cardboard/library/**" />
+ <include name="libraries/cardboard/src/**" />
<exclude name="**/._*" />
</zipfileset>
</zip>
View
@@ -1,8 +1,5 @@
-apply plugin: 'java'
-
buildscript {
repositories {
-// mavenCentral()
jcenter()
}
dependencies {
@@ -11,21 +8,6 @@ buildscript {
}
}
-// Find location of android jar relative to ANDROID_HOME
-def android_platform = "$sdkdir/platforms/android-$sdkver"
-def core_jar_path = "../android-core.zip"
-
-// Check to see if required API exists
-// TODO: Look for any higher SDK and use it.
-if (!file(android_platform).exists()) {
- logger.error "Android SDK $sdkver could not be found in $sdkdir"
-}
-
-repositories {
- //jcenter()
- flatDir {dirs 'library', android_platform}
-}
-
dependencies {
compile name: 'android'
compile name: 'android-support-v4'
@@ -43,7 +25,6 @@ sourceSets {
}
}
-// Create Jar
jar {
manifest {
attributes(
@@ -67,6 +48,7 @@ task dist {
Files.copy(file("$buildDir/libs/core.jar").toPath(),
file("$buildDir/libs/android-core.zip").toPath(), REPLACE_EXISTING);
+ // and copy it to root
Files.copy(file("$buildDir/libs/core.jar").toPath(),
file("$core_jar_path").toPath(), REPLACE_EXISTING);
}
@@ -1,8 +1,5 @@
-apply plugin: 'java'
-
buildscript {
repositories {
-// mavenCentral()
jcenter()
}
dependencies {
@@ -11,21 +8,6 @@ buildscript {
}
}
-// Find location of android jar relative to ANDROID_HOME
-def android_platform = "$sdkdir/platforms/android-$sdkver"
-def core_libs_path = "../../core/build/libs"
-
-// Check to see if required API exists
-// TODO: Look for any higher SDK and use it.
-if (!file(android_platform).exists()) {
- logger.error "Android SDK $sdkver could not be found in $sdkdir"
-}
-
-repositories {
- //jcenter()
- flatDir {dirs 'lib', core_libs_path, android_platform}
-}
-
dependencies {
compile name: 'android'
compile name: 'core'
@@ -45,7 +27,6 @@ sourceSets {
}
}
-// Create Jar
jar {
manifest {
attributes(
@@ -56,7 +37,7 @@ jar {
}
clean.doFirst {
-// delete "$core_jar_path"
+ delete "library/cardboard.jar"
}
import groovy.util.AntBuilder
@@ -65,12 +46,9 @@ import static java.nio.file.StandardCopyOption.*;
task dist {
doLast {
- // make copy of jar file as zip
-// Files.copy(file("$buildDir/libs/core.jar").toPath(),
-// file("$buildDir/libs/android-core.zip").toPath(), REPLACE_EXISTING);
-
-// Files.copy(file("$buildDir/libs/core.jar").toPath(),
-// file("$core_jar_path").toPath(), REPLACE_EXISTING);
+ // make copy of jar file to library folder
+ Files.copy(file("$buildDir/libs/cardboard.jar").toPath(),
+ file("library/cardboard.jar").toPath(), REPLACE_EXISTING);
}
}
@@ -40,62 +40,4 @@
../../../processing/java/mode/jdtCompilerAdapter.jar" />
</javac>
</target>
-
- <target name="dist" depends="build" description="Creates distribution package">
- <mkdir dir="dist/tmp/cardboard" />
-
- <!-- copy library files (jar and natives) -->
- <copy todir="dist/tmp/cardboard/library">
- <fileset dir="library" />
- </copy>
-
- <!-- copy examples -->
- <copy todir="dist/tmp/cardboard/examples">
- <fileset dir="examples" />
- </copy>
-
- <!-- copy source -->
- <copy todir="dist/tmp/cardboard/src">
- <fileset dir="src" />
- </copy>
-
- <!-- copy GVR SDK (needed by the mode to build the carboard app) -->
- <copy todir="dist/tmp/cardboard/gvrsdk">
- <fileset dir="gvrsdk" />
- </copy>
-
- <!-- copy properties -->
- <copy file="library.properties" tofile="dist/tmp/cardboard/library.properties" />
-
- <!-- create the java reference of the library -->
- <!--
- <mkdir dir="dist/tmp/video_android/reference" />
- <javadoc bottom="Processing video library by The Processing Foundation. (c) 2011-14"
- classpath="../processing/core/library/core.jar;bin"
- destdir="dist/tmp/video_android/reference"
- verbose="false"
- stylesheetfile="resources/stylesheet.css"
- doctitle="Javadocs: Video library for Android"
- public="true" version="false"
- windowtitle="Javadocs: Video library for Android">
- <link href="http://java.sun.com/javase/6/docs/api/" />
- <link href="http://github.com/omerjerk" />
- <taglet name="ExampleTaglet" path="resources/code" />
- <fileset dir="dist/tmp/video/src" defaultexcludes="yes">
- <include name="**/*"/>
- </fileset>
- </javadoc> -->
-
- <!-- create zip package -->
- <delete file="dist/cardboard.zip"/>
- <zip destfile="dist/cardboard.zip"
- basedir="dist/tmp"
- excludes="**/.DS_Store"
- />
-
- <!-- copy properties to use by download manager -->
- <copy file="library.properties" tofile="dist/cardboard.txt" />
-
- <delete dir="dist/tmp" />
- </target>
</project>

0 comments on commit 89d35ca

Please sign in to comment.