summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2014-11-10 14:24:36 -0330
committerDwayne Boone <dwayne@zeroc.com>2014-11-10 14:24:36 -0330
commitd138d15603cbef6e8a180a13657d4b200379dc76 (patch)
treee6265e6e5b766ff9c5c07b8139f3d28dab961a55
parentAddendum to BerkeleyDB fix (diff)
downloadice-d138d15603cbef6e8a180a13657d4b200379dc76.tar.bz2
ice-d138d15603cbef6e8a180a13657d4b200379dc76.tar.xz
ice-d138d15603cbef6e8a180a13657d4b200379dc76.zip
Fixed android and demo builds
-rw-r--r--android/demo/chat/build.gradle13
-rw-r--r--android/demo/hello/build.gradle10
-rw-r--r--android/demo/library/build.gradle13
-rw-r--r--android/gradle.properties6
-rw-r--r--android/gradle/library.gradle27
-rw-r--r--android/settings.gradle27
-rw-r--r--android/test/android/build.gradle2
-rw-r--r--android/test/build.gradle6
-rw-r--r--android/test/plugins/build.gradle2
-rwxr-xr-xdistribution/makedist.py2
-rw-r--r--distribution/src/common/gradle.properties12
-rw-r--r--distribution/src/common/ice.gradle101
-rw-r--r--java/src/Freeze/build.gradle1
13 files changed, 167 insertions, 55 deletions
diff --git a/android/demo/chat/build.gradle b/android/demo/chat/build.gradle
index b3d7829da81..24efbb7308b 100644
--- a/android/demo/chat/build.gradle
+++ b/android/demo/chat/build.gradle
@@ -55,14 +55,7 @@ idea.module {
buildDir.listFiles({d, f ->f != 'generated-src'} as FilenameFilter).each { excludeDirs += it }
}
-if (distJarDir == null) {
- dependencies {
- compile project(':Ice')
- compile project(':Glacier2')
- }
-} else {
- dependencies {
- compile files("${distJarDir}/Ice${versionSuffix}.jar")
- compile files("${distJarDir}/Glacier2${versionSuffix}.jar")
- }
+dependencies {
+ compile localDependency('ice')
+ compile localDependency('glacier2')
}
diff --git a/android/demo/hello/build.gradle b/android/demo/hello/build.gradle
index dbd48af15e1..e7cd99241e8 100644
--- a/android/demo/hello/build.gradle
+++ b/android/demo/hello/build.gradle
@@ -54,12 +54,6 @@ idea.module {
buildDir.listFiles({d, f ->f != 'generated-src'} as FilenameFilter).each { excludeDirs += it }
}
-if (distJarDir == null) {
- dependencies {
- compile project(':Ice')
- }
-} else {
- dependencies {
- compile files("${distJarDir}/Ice${versionSuffix}.jar")
- }
+dependencies {
+ compile localDependency('ice')
}
diff --git a/android/demo/library/build.gradle b/android/demo/library/build.gradle
index 089469fbaa9..e095f2ca73e 100644
--- a/android/demo/library/build.gradle
+++ b/android/demo/library/build.gradle
@@ -55,14 +55,7 @@ idea.module {
buildDir.listFiles({d, f ->f != 'generated-src'} as FilenameFilter).each { excludeDirs += it }
}
-if (distJarDir == null) {
- dependencies {
- compile project(':Ice')
- compile project(':Glacier2')
- }
-} else {
- dependencies {
- compile files("${distJarDir}/Ice${versionSuffix}.jar")
- compile files("${distJarDir}/Glacier2${versionSuffix}.jar")
- }
+dependencies {
+ compile localDependency('ice')
+ compile localDependency('glacier2')
}
diff --git a/android/gradle.properties b/android/gradle.properties
index 8f1c35b7837..e8f6ab32143 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -10,10 +10,10 @@
iceVersion = 3.6b
//
-// Oracle Berkeley DB version, only needed if you want to build
-// Freeze.
+// Oracle Berkeley DB JAR location. Should only need to be set if Berkeley DB
+// is installed in a non-standard location.
//
-dbVersion = 5.3.28
+dbHome =
//
// Select an installation base directory. The directory will be created
diff --git a/android/gradle/library.gradle b/android/gradle/library.gradle
new file mode 100644
index 00000000000..fb8e14d3737
--- /dev/null
+++ b/android/gradle/library.gradle
@@ -0,0 +1,27 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+jar {
+ destinationDir = new File("${libDir}")
+}
+
+clean {
+ delete("${libDir}/${jar.archiveName}")
+}
+
+task copyJars(type: Copy, dependsOn: jar) {
+ from "${libDir}/${jar.archiveName}"
+ into "${DESTDIR}${prefix}/lib"
+}
+task install(dependsOn: copyJars)
+
+idea.module {
+ excludeDirs -= file(buildDir)
+ buildDir.listFiles({d, f ->f != 'generated-src'} as FilenameFilter).each { excludeDirs += it }
+}
diff --git a/android/settings.gradle b/android/settings.gradle
index dc291e41619..91b6dd13e97 100644
--- a/android/settings.gradle
+++ b/android/settings.gradle
@@ -15,14 +15,25 @@ tests.each {
}
// Main source
-include ':hello', ':Ice', ':Glacier2', ':IceBox', ':IceDiscovery', ':IceGrid', ':IcePatch2', ':IceStorm', ':chat', ':library', ':test', ':testPlugins', ':testApp', ':test_Ice_acm'
-project(':Ice').projectDir = new File('src/Ice')
-project(':Glacier2').projectDir = new File('src/Glacier2')
-project(':IceBox').projectDir = new File('src/IceBox')
-project(':IceDiscovery').projectDir = new File('src/IceDiscovery')
-project(':IceGrid').projectDir = new File('src/IceGrid')
-project(':IcePatch2').projectDir = new File('src/IcePatch2')
-project(':IceStorm').projectDir = new File('src/IceStorm')
+include ':ice'
+project(':ice').projectDir = new File('src/Ice')
+include ':icediscovery'
+project(':icediscovery').projectDir = new File('src/IceDiscovery')
+include ':freeze'
+project(':freeze').projectDir = new File('src/Freeze')
+include ':icebox'
+project(':icebox').projectDir = new File('src/IceBox')
+include ':glacier2'
+project(':glacier2').projectDir = new File('src/Glacier2')
+include ':icepatch2'
+project(':icepatch2').projectDir = new File('src/IcePatch2')
+include ':icestorm'
+project(':icestorm').projectDir = new File('src/IceStorm')
+include ':icegrid'
+project(':icegrid').projectDir = new File('src/IceGrid')
+
+include ':hello', ':chat', ':library', ':test', ':testPlugins', ':testApp', ':test_Ice_acm'
+
project(':hello').projectDir = new File('demo/hello')
project(':chat').projectDir = new File('demo/chat')
project(':library').projectDir = new File('demo/library')
diff --git a/android/test/android/build.gradle b/android/test/android/build.gradle
index 57f653c6d19..9d9168f6f21 100644
--- a/android/test/android/build.gradle
+++ b/android/test/android/build.gradle
@@ -77,7 +77,7 @@ tests.each {
}
dependencies {
- compile project(':Ice')
+ compile localDependency('ice')
compile project(':test')
compile project(':testPlugins')
}
diff --git a/android/test/build.gradle b/android/test/build.gradle
index 8444ad17fff..723aa3f8d0c 100644
--- a/android/test/build.gradle
+++ b/android/test/build.gradle
@@ -1,4 +1,4 @@
-// **********************************************************************
+ //**********************************************************************
//
// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
@@ -31,7 +31,7 @@ idea.module {
}
dependencies {
- compile project(':Ice')
+ compile localDependency('ice')
}
tests.each {
@@ -76,7 +76,7 @@ tests.each {
dependencies {
compile project(':test')
- compile project(':Ice')
+ compile localDependency('ice')
}
}
}
diff --git a/android/test/plugins/build.gradle b/android/test/plugins/build.gradle
index a36daf037fb..30ff633c18b 100644
--- a/android/test/plugins/build.gradle
+++ b/android/test/plugins/build.gradle
@@ -42,5 +42,5 @@ idea.module {
}
dependencies {
- compile project(':Ice')
+ compile localDependency('ice')
}
diff --git a/distribution/makedist.py b/distribution/makedist.py
index bc98e64792b..d8847eff165 100755
--- a/distribution/makedist.py
+++ b/distribution/makedist.py
@@ -684,7 +684,7 @@ print "Cleaning up...",
sys.stdout.flush()
remove(srcDir)
remove(winSrcDir)
-#remove(demoDir)
+remove(demoDir)
remove(winDemoDir)
remove(demoscriptDir)
remove(winDemoscriptDir)
diff --git a/distribution/src/common/gradle.properties b/distribution/src/common/gradle.properties
index 18c7cfe2afd..bda82b3650c 100644
--- a/distribution/src/common/gradle.properties
+++ b/distribution/src/common/gradle.properties
@@ -10,16 +10,10 @@
iceVersion = 3.6b
//
-// Oracle Berkeley DB version, only needed if you want to build
-// Freeze.
+// Oracle Berkeley DB JAR location. Should only need to be set if Berkeley DB
+// is installed in a non-standard location.
//
-dbVersion = 5.3.28
-
-//
-// If set to yes, the demo build uses Ice JARs from the ZeroC Maven repository.
-// If set to no, the demo build uses Ice JARs installed locally.
-//
-useMavenArtifacts = yes
+dbHome =
//
// Define debug as true if you want to build with debug information,
diff --git a/distribution/src/common/ice.gradle b/distribution/src/common/ice.gradle
index a2c5b1a285c..0a0a4cdd863 100644
--- a/distribution/src/common/ice.gradle
+++ b/distribution/src/common/ice.gradle
@@ -34,6 +34,7 @@ try {
// Determine the name of the Slice-to-Java translator
def isWindows = false
+def isOSX = false
def slice2java = "slice2java"
def slice2freezej = "slice2freezej"
if (System.properties['os.name'].toLowerCase().contains('windows'))
@@ -42,6 +43,10 @@ if (System.properties['os.name'].toLowerCase().contains('windows'))
slice2java = "slice2java.exe"
slice2freezej = "slice2freezej.exe"
}
+else if(System.properties['os.name'] == "Mac OS X")
+{
+ isOSX = true
+}
// First check if ICE_HOME is set and it points at a valid installation
def env = System.getenv()
@@ -145,3 +150,99 @@ def localDependency(artifactId) {
ext {
localDependency = this.&localDependency
}
+
+//
+// Find BerkeleyDB JAR
+//
+if (isWindows || isOSX)
+{
+ ext.dbVersion = "5.3.28"
+}
+else
+{
+ ext.dbVersion = "5.3.21"
+}
+
+ext.dbJar = ""
+if(dbHome != "")
+{
+ ext.dbJar = "${dbHome}/db-${dbVersion}.jar"
+}
+else
+{
+ ["db-${dbVersion}.jar", "db.jar"].each {
+ if (ext.dbJar.length() != 0)
+ {
+ // Already found DB JAR, just ignore.
+ }
+ else if (isWindows)
+ {
+ def thirdpartyhome = env['THIRDPARTY_HOME']
+ if (thirdpartyhome == null || thirpartyhome.length() == 0)
+ {
+ def progFiles
+ def arch1 = env['PROCESSOR_ARCHITECTURE']
+ def arch2 = env['PROCESSOR_ARCHITEW6432']
+ if (arch1 == "AMD64" || arch1 == "IA64" || arch2 == "AMD64" || arch2 == "IA64")
+ {
+ progFiles = env['ProgramFiles(x86)']
+ }
+ else
+ {
+ progFiles = env['ProgramFiles']
+ }
+ thirdpartyhome = "$progFiles\\ZeroC\\Ice-$iceVersion-ThirdParty"
+ }
+
+ def f = new File("$thirdpartyhome\\lib\\${it}")
+ if (f.exists())
+ {
+ ext.dbJar = "$thirdpartyhome\\lib\\${it}"
+ }
+ }
+ else
+ {
+ def f = new File("/Library/Developer/Ice-$iceVersion-ThirdParty/lib/${it}")
+ if (f.exists())
+ {
+ ext.dbJar = "/Library/Developer/Ice-$iceVersion-ThirdParty/lib/${it}"
+ }
+
+ if (ext.dbJar.length() == 0)
+ {
+ f = new File("/usr/share/java/${it}")
+ if (f.exists())
+ {
+ ext.dbJar = "/usr/share/java/lib/${it}"
+ }
+ }
+
+ if (ext.dbJar.length() == 0)
+ {
+ f = new File("/opt/Ice-${iceVersion}/lib/${it}")
+ if (f.exists())
+ {
+ ext.dbJar = "/opt/Ice-${iceVersion}/lib/${it}"
+ }
+ }
+
+ if (ext.dbJar.length() == 0)
+ {
+ f = new File("/opt/db/lib/${it}")
+ if (f.exists())
+ {
+ ext.dbJar = "/opt/db/lib/${it}"
+ }
+ }
+
+ if (ext.dbJar.length() == 0)
+ {
+ f = new File("/usr/lib/${it}")
+ if (f.exists())
+ {
+ ext.dbJar = "/usr/lib/${it}"
+ }
+ }
+ }
+ }
+}
diff --git a/java/src/Freeze/build.gradle b/java/src/Freeze/build.gradle
index a21eab38dbb..881028327a2 100644
--- a/java/src/Freeze/build.gradle
+++ b/java/src/Freeze/build.gradle
@@ -40,7 +40,6 @@ slice {
dependencies {
compile project(':ice')
- print dbJar
compile files(dbJar)
}