Permalink
Browse files

working on gradle build file for cardboard

  • Loading branch information...
1 parent 1b731f5 commit 92c5fc8ed7b6778b7c5f0b825270b73e196e74cd @codeanticode codeanticode committed Jan 4, 2017
Showing with 89 additions and 31 deletions.
  1. +2 −8 build.gradle
  2. +7 −20 core/build.gradle
  3. +77 −0 libraries/cardboard/build.gradle
  4. +2 −2 libraries/cardboard/build.xml
  5. +1 −1 settings.gradle
View
@@ -12,8 +12,6 @@ buildscript {
apply plugin: 'java'
-
-
allprojects {
apply plugin: 'java'
// Find location of android jar relative to ANDROID_HOME
@@ -29,11 +27,10 @@ allprojects {
targetCompatibility = 1.7
}
-
-
dependencies {
compile name: 'android'
compile project(":core")
+ compile project(":libraries:cardboard")
compile group: 'org.processing', name: 'core', version: '3.2.3'
compile group: 'org.processing', name: 'pde', version: '3.2.3'
compile group: 'org.processing', name: 'java-mode', version: '3.2.3'
@@ -47,7 +44,6 @@ sourceSets {
}
}
-
import java.nio.file.Files
import org.zeroturnaround.zip.ZipUtil
import org.apache.commons.io.FileUtils
@@ -56,6 +52,7 @@ import static java.nio.file.StandardCopyOption.*;
task dist {
try {
def root = "$buildDir/zip/AndroidMode"
+
// Copy assets to build dir
FileUtils.copyDirectory(file("templates"), file("$root/templates"))
FileUtils.copyDirectory(file("examples"), file("$root/examples"))
@@ -77,9 +74,6 @@ task dist {
ZipUtil.pack(file("$buildDir/zip"), new File("release/AndroidMode.zip"))
Files.copy(file("mode.properties").toPath(),
file("release/AndroidMode.txt").toPath(), REPLACE_EXISTING);
- Files.copy(file("core/build/libs/android-core.zip").toPath(),
- file("android-core.zip").toPath(), REPLACE_EXISTING);
-
} catch (Exception ex) {
logger.error ex.getMessage()
}
View
@@ -8,12 +8,12 @@ buildscript {
dependencies {
classpath group: 'commons-io', name: 'commons-io', version: '2.5'
classpath group: 'org.zeroturnaround', name: 'zt-zip', version: '1.9'
-
}
}
// 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.
@@ -28,16 +28,7 @@ repositories {
dependencies {
compile name: 'android'
-
- // android-support-v4.jar is in $sdkdir/extras/android/support/v4
compile name: 'android-support-v4'
-
- // Could not find the source of the wearable aars in Android Studio, so far
- // these two repositories seem to have up-to-date versions:
- // http://mvn.sibext.com/com/google/android/support/wearable/
- // http://uiq3.sourceforge.net/Repository/com/google/android/support/wearable/
- // MavenCentral and JCenter don't seem to have any wearable file.
- // Use the wear-update script to create a new wearable-$version jar
compile name: 'wearable-1.4.0'
}
@@ -52,7 +43,6 @@ sourceSets {
}
}
-
// Create Jar
jar {
manifest {
@@ -61,27 +51,24 @@ jar {
"Gradle-Version": "$gradle.gradleVersion"
)
}
-
+}
+clean.doFirst {
+ delete "$core_jar_path"
}
import groovy.util.AntBuilder
import java.nio.file.Files
import static java.nio.file.StandardCopyOption.*;
-//import org.apache.commons.io.FileUtils
-//import org.zeroturnaround.zip.ZipUtil
-
-
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);
-
- //FileUtils.copyDirectory(file("src/assets"), file("$buildDir/zip/assets"))
- //FileUtils.copyDirectory(file("$buildDir/classes/main"), file("$buildDir/zip/"))
- //ZipUtil.pack(file("$buildDir/zip"), new File("$buildDir/libs/android-core.zip"))
+
+ Files.copy(file("$buildDir/libs/core.jar").toPath(),
+ file("$core_jar_path").toPath(), REPLACE_EXISTING);
}
}
@@ -0,0 +1,77 @@
+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'
+ }
+}
+
+// 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'
+ compile name: 'gvr-base'
+ compile name: 'gvr-common'
+ compile name: 'gvr-audio'
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src/']
+ }
+ resources {
+ srcDirs = ['src/']
+ }
+ }
+}
+
+// Create Jar
+jar {
+ manifest {
+ attributes(
+ "Manifest-Version": "1.0",
+ "Gradle-Version": "$gradle.gradleVersion"
+ )
+ }
+}
+
+clean.doFirst {
+// delete "$core_jar_path"
+}
+
+import groovy.util.AntBuilder
+import java.nio.file.Files
+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);
+ }
+}
+
+dist.dependsOn build
@@ -30,8 +30,8 @@
encoding="UTF-8"
includeAntRuntime="false"
classpath="lib/gvr-base.jar;
- lib/gvr-common.jar;
- lib/gvr-audio.jar;
+ lib/gvr-common.jar;
+ lib/gvr-audio.jar;
../../android-core.zip;
${env.ANDROID_SDK}/platforms/android-23/android.jar"
nowarn="true"
View
@@ -1 +1 @@
-include 'core'
+include 'core', 'libraries:cardboard'

0 comments on commit 92c5fc8

Please sign in to comment.