From 4302602b6381054c00b5282b14a06d5e3f3f1f86 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Thu, 28 Aug 2014 14:25:58 -0600 Subject: [PATCH 1/5] Add win32/win64 dependencies --- build.gradle | 53 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 3d8822efee..f34aee9a95 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,28 @@ apply plugin: 'ivy-publish' apply plugin: 'java' apply plugin: 'artifactory-publish' +ext { + libDir = "${buildDir}/lib" +} + +repositories { + ivy { + name "ivyLocal" + url "${System.env.HOME}/.ivy2/local" + layout 'maven' + } +} + +configurations { + create('windows-i386') + create('windows-x86_64') +} + +dependencies { + 'windows-i386' "com.readytalk:win32:1.0.0-SNAPSHOT" + 'windows-x86_64' "com.readytalk:win64:1.0.0-SNAPSHOT" +} + model { platforms { if(project.hasProperty("platform") && project.hasProperty("arch")) { @@ -49,6 +71,16 @@ model { executable "make" args "platform=${platform.operatingSystem.name}", "arch=${platform.architecture.name}" + switch ( platform.name ) { + case "windows-i386": + dependsOn extractWin32 + args "win32=${libDir}/tools/win32" + break + case "windows-x86_64": + dependsOn extractWin64 + args "win32=${libDir}/tools/win64" + break + } environment JAVA_HOME: "/usr/local/java" } @@ -59,6 +91,20 @@ model { } } +task extractWin32(type: Copy) { + from { + tarTree(configurations."windows-i386".find { it.name =~ 'win32' }) + } + into "${libDir}/tools" +} + +task extractWin64(type: Copy) { + from { + tarTree(configurations."windows-x86_64".find { it.name =~ 'win64' }) + } + into "${libDir}/tools" +} + tasks.withType(JavaCompile) { sourceCompatibility = "1.6" targetCompatibility = "1.6" @@ -98,10 +144,7 @@ task install { publishing { repositories { - ivy { - url "${System.env.HOME}/.ivy2/local" - layout 'maven' - } + add(project.repositories."ivyLocal") } publications { @@ -147,6 +190,7 @@ publishing { } } +/** artifactoryPublish { dependsOn assemble } @@ -177,6 +221,7 @@ artifactory { } } } +**/ task wrapper(type: Wrapper) { gradleVersion = '2.0' From 72d9c8e191a0c8055d2247db1d0c64ec99f9c0e7 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Thu, 28 Aug 2014 14:41:31 -0600 Subject: [PATCH 2/5] Uncomment artifactoryPublish section --- build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.gradle b/build.gradle index f34aee9a95..1f42e5b498 100644 --- a/build.gradle +++ b/build.gradle @@ -190,7 +190,6 @@ publishing { } } -/** artifactoryPublish { dependsOn assemble } @@ -221,7 +220,6 @@ artifactory { } } } -**/ task wrapper(type: Wrapper) { gradleVersion = '2.0' From c9dc5b1a9c03fd8991529908fef9f5c1dd9db623 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Thu, 28 Aug 2014 14:48:21 -0600 Subject: [PATCH 3/5] Update wrapper to http (not https) for squeeze purposes --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 1f42e5b498..bc5c0cf8d0 100644 --- a/build.gradle +++ b/build.gradle @@ -222,5 +222,5 @@ artifactory { } task wrapper(type: Wrapper) { - gradleVersion = '2.0' + distributionUrl = 'http://services.gradle.org/distributions/gradle-2.0-bin.zip' } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1aad35515..84bf862c89 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Jul 23 15:29:56 MDT 2014 +#Thu Aug 28 14:47:06 MDT 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip +distributionUrl=http\://services.gradle.org/distributions/gradle-2.0-bin.zip From 35c677ba0b19eed79eafee617b4058f1a4ac2478 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Thu, 28 Aug 2014 14:58:35 -0600 Subject: [PATCH 4/5] Add snapshot/release repo --- build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build.gradle b/build.gradle index bc5c0cf8d0..8bc5c415fb 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,16 @@ repositories { url "${System.env.HOME}/.ivy2/local" layout 'maven' } + + ivy { + name "jcenter" + if(version.contains("SNAPSHOT")) { + url "http://oss.jfrog.org/artifactory/oss-snapshot-local" + } else { + url "http://oss.jfrog.org/artifactory/oss-release-local" + } + layout 'maven' + } } configurations { From 1be50ba412fbe7dbc38b694fa2fb602a55345c7e Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Thu, 28 Aug 2014 15:46:10 -0600 Subject: [PATCH 5/5] Clean up win32/64 extraction --- build.gradle | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index e5c921e377..5ecf1afb07 100644 --- a/build.gradle +++ b/build.gradle @@ -117,19 +117,26 @@ model { tasks { platforms.each { platform -> + if(platform.operatingSystem.name == "windows") { + def artifactName = platform.architecture.name == "i386" ? 'win32' : 'win64' + + task "extract${platform.name}"(type: Copy) { + from { + tarTree(configurations."${platform.name}".find { it.name =~ artifactName }) + } + into "${libDir}/tools" + } + } + task "build${platform.name}"(type: Exec) { executable "make" args "platform=${platform.operatingSystem.name}", "arch=${platform.architecture.name}" - switch ( platform.name ) { - case "windows-i386": - dependsOn extractWin32 - args "win32=${libDir}/tools/win32" - break - case "windows-x86_64": - dependsOn extractWin64 - args "win32=${libDir}/tools/win64" - break + if(platform.operatingSystem.name == "windows") { + dependsOn "extract${platform.name}" + args "win32=${libDir}/tools/win32", + "win64=${libDir}/tools/win64" + } environment JAVA_HOME: java_home } @@ -140,20 +147,6 @@ model { } } -task extractWin32(type: Copy) { - from { - tarTree(configurations."windows-i386".find { it.name =~ 'win32' }) - } - into "${libDir}/tools" -} - -task extractWin64(type: Copy) { - from { - tarTree(configurations."windows-x86_64".find { it.name =~ 'win64' }) - } - into "${libDir}/tools" -} - tasks.withType(JavaCompile) { sourceCompatibility = "1.6" targetCompatibility = "1.6"