ice-builder-gradle-1.4.5/0000775000175000017500000000000013233633501013624 5ustar josejoseice-builder-gradle-1.4.5/gradle.properties0000664000175000017500000000114513233633150017201 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** // // Select an installation base directory. The directory will be created // if it does not exist. If this property is not set the default will be // used. Default values are: // - Windows: C:\ice-builder-gradle-${project.version} // - Non Windows /opt/ice-builder-gradle-${project.version} // prefix = // // Set to true to avoid dependencies from non local repositories // localOnly = false ice-builder-gradle-1.4.5/src/0000775000175000017500000000000013233633150014413 5ustar josejoseice-builder-gradle-1.4.5/src/test/0000775000175000017500000000000013233633150015372 5ustar josejoseice-builder-gradle-1.4.5/src/test/groovy/0000775000175000017500000000000013233633150016717 5ustar josejoseice-builder-gradle-1.4.5/src/test/groovy/com/0000775000175000017500000000000013233633150017475 5ustar josejoseice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/0000775000175000017500000000000013233633150020617 5ustar josejoseice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/0000775000175000017500000000000013233633150022055 5ustar josejoseice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/0000775000175000017500000000000013233633150024164 5ustar josejoseice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/0000775000175000017500000000000013233633150025263 5ustar josejose././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/SliceJarDirectoryTest.groovyice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/SliceJarDirectoryTest.gro0000664000175000017500000000577613233633150032234 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice import org.junit.After import org.junit.Before import org.junit.Test import static org.junit.Assert.assertNotNull import static org.junit.Assert.assertTrue class SliceJarDirectoryTest extends TestCase { def iceHome = null @Before public void createIceHome() { def isWindows = System.getProperty('os.name').toLowerCase().contains('windows') iceHome = File.createTempDir() createIceHomePath(["bin"]) def copyFileBytes = { src, dst -> def srcFile = new File(src) def dstFile = new File(dst) dstFile << srcFile.bytes return dstFile } def dst = [iceHome.toString(), "bin", new File(project.slice.slice2java).getName()].join(File.separator) copyFileBytes(project.slice.slice2java, dst).setExecutable(true) // For Ice 3.6 we also copy slice2java dependencies. // This is unnecessary in Ice 3.7 as slice2java is statically linked if(isWindows && project.slice.compareIceVersion("3.7") == -1) { ['slice36.dll', 'iceutil36.dll'].each { def src = [new File(project.slice.slice2java).getParent(), it].join(File.separator) copyFileBytes(src, [iceHome.toString(), "bin", it].join(File.separator)).setExecutable(true) } } } @After public void cleanupIceHome() { // if(iceHome) { // iceHome.deleteDir() // iceHome.deleteOnExit() // } } def createIceHomePath(path) { def newPath = new File([iceHome.toString(), path.join(File.separator)].join(File.separator)) newPath.mkdirs() newPath.toString() } @Test public void testSliceCommon() { def tmpSliceDir = createIceHomePath(["share", "slice"]) project.slice.iceHome = iceHome.toString() assertNotNull(project.slice.sliceDir) assertTrue(project.slice.sliceDir == tmpSliceDir) } @Test public void testIce37SliceDir() { def tmpSliceDir = createIceHomePath(["share", "ice", "slice"]) project.slice.iceHome = iceHome.toString() assertNotNull(project.slice.sliceDir) assertTrue(project.slice.sliceDir == tmpSliceDir) } @Test public void testIce36SliceDir() { def tmpSliceDir = createIceHomePath(["share", "Ice-${project.slice.iceVersion}", "slice"]) project.slice.iceHome = iceHome.toString() assertNotNull(project.slice.sliceDir) assertTrue(project.slice.sliceDir == tmpSliceDir) } @Test public void testOptSourceSliceDir() { def tmpSliceDir = createIceHomePath(["slice"]) project.slice.iceHome = iceHome.toString() assertNotNull(project.slice.sliceDir) assertTrue(project.slice.sliceDir == tmpSliceDir) } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/Slice2JavaPluginTest.groovyice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/Slice2JavaPluginTest.groo0000664000175000017500000000537613233633150032130 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice import org.junit.Test import org.gradle.testfixtures.ProjectBuilder import static org.junit.Assert.assertTrue class Slice2JavaPluginTest extends TestCase { @Test public void testSlice2JavaWithDefaults() { // Where builder checks for slice files by default pathToFile([project.rootDir, 'src', 'main', 'slice']).mkdirs() writeTestSliceToFile(pathToFile([project.rootDir, 'src', 'main', 'slice', 'Test.ice'])) project.tasks.compileSlice.execute() assertTrue(pathToFile([project.rootDir, 'build', 'generated-src', 'Test']).exists()) assertTrue(pathToFile([project.rootDir, 'build', 'generated-src', 'Test', 'Hello.java']).exists()) } @Test public void testSlice2JavaSliceSrcDir() { def sliceDir = pathToFile([project.rootDir, 'src', 'other', 'slice']) sliceDir.mkdirs() project.slice.java { srcDir = sliceDir.toString() } writeTestSliceToFile(pathToFile([project.rootDir, 'src', 'other', 'slice', 'Test.ice'])) project.tasks.compileSlice.execute() assertTrue(pathToFile([project.rootDir, 'build', 'generated-src', 'Test']).exists()) assertTrue(pathToFile([project.rootDir, 'build', 'generated-src', 'Test', 'Hello.java']).exists()) } @Test public void testRemovingGeneratedFiles() { // Where builder checks for slice files by default pathToFile([project.rootDir, 'src', 'main', 'slice']).mkdirs() writeTestSliceToFile(pathToFile([project.rootDir, 'src', 'main', 'slice', 'Test.ice'])) project.tasks.compileSlice.execute() def geneatedHello = pathToFile([project.rootDir, 'build', 'generated-src', 'Test', 'Hello.java']) assertTrue(geneatedHello.exists()) geneatedHello.delete() assertTrue(!geneatedHello.exists()) // Project tasks should not be re-executed and we are not using a tool like // GradleConnector/GradleRunner. So instead we make a new project and run it. def p = newProjectWithProjectDir() p.pluginManager.apply 'java' p.pluginManager.apply 'slice' p.tasks.compileSlice.execute() assertTrue(geneatedHello.exists()) } private void writeTestSliceToFile(file) { file << """ |module Test |{ | |interface Hello |{ | idempotent void sayHello(int delay); | void shutdown(); |}; | |}; """.stripMargin() } } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/Slice2JavaNuGetIceHome.groovyice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/Slice2JavaNuGetIceHome.gr0000664000175000017500000000256113233633150031741 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice import org.junit.Before import org.junit.Test import static org.junit.Assert.assertTrue import static org.junit.Assume.assumeTrue class Slice2JavaNuGetIceHome extends TestCase { @Before public void checkIsWindows() { // For what we are testing our ice version must be >= 3.7 on Windows os assumeTrue(project.slice.compareIceVersion('3.7') >= 0) assumeTrue(System.getProperty('os.name').toLowerCase().contains('windows')) } @Test void testCppNugetIceHome() { def nuget = File.createTempDir() def tools = new File([nuget.toString(), "tools"].join(File.separator)) tools.mkdirs() def copyFileBytes = { src, dst -> def srcFile = new File(src) def dstFile = new File(dst) dstFile << srcFile.bytes return dstFile } def dst = [nuget.toString(), "tools", new File(project.slice.slice2java).getName()].join(File.separator) copyFileBytes(project.slice.slice2java, dst).setExecutable(true) project.slice.iceHome = nuget.toString() assertTrue(project.slice.slice2java == dst) } } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/SlicePluginWarningTest.groovyice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/SlicePluginWarningTest.gr0000664000175000017500000000162013233633150032220 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice import org.junit.Test import static org.junit.Assert.assertTrue import static org.junit.Assume.assumeTrue class SlicePluginWarningTest extends TestCase { @Test public void testWarning() { pathToFile([project.rootDir, 'src', 'main', 'slice']).mkdirs() writeTestSliceToFile(pathToFile([project.rootDir, 'src', 'main', 'slice', 'Test.ice'])) project.tasks.compileSlice.execute() } private void writeTestSliceToFile(file) { file << """ |module Test |{ | |["java:buffer"] sequence TestSeq; | |}; """.stripMargin() } } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/SlicePluginPropertyTest.groovyice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/SlicePluginPropertyTest.g0000664000175000017500000001047513233633150032265 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice import org.junit.Rule import org.junit.Test import org.junit.contrib.java.lang.system.EnvironmentVariables import static org.junit.Assert.* import static org.junit.Assume.* class SlicePluginPropertyTest extends TestCase { @Rule public final EnvironmentVariables environmentVariables = new EnvironmentVariables(); @Test public void pluginAddsCompileSliceTaskToProject() { assertTrue(project.tasks.compileSlice instanceof SliceTask) } @Test public void testAutoDetectIceHome() { // This test only works if ICE_HOME is not set assumeTrue(System.getenv()['ICE_HOME'] == null) assertTrue(project.slice.iceHome != "") assertTrue(project.slice.srcDist == false) assertTrue(project.slice.iceVersion != "" && project.slice.iceVersion != null) assertTrue(new File(project.slice.slice2java).exists()) assertTrue(new File(project.slice.sliceDir).exists()) } @Test public void testManualBinDistIceHome() { // This test only works if ICE_HOME is not set assumeTrue(System.getenv()['ICE_HOME'] == null) def iceHome = project.slice.iceHome project.slice.iceHome = iceHome assertTrue(project.slice.iceHome != "") assertNotNull(project.slice.iceHome) assertTrue(project.slice.srcDist == false) assertTrue(project.slice.iceVersion != "") assertNotNull(project.slice.iceVersion) assertTrue(new File(project.slice.slice2java).exists()) assertTrue(new File(project.slice.sliceDir).exists()) } @Test public void testInvalidIceHome() { // // Test an bogus iceHome (non srcDist) // def tmpIceHome = File.createTempDir() tmpIceHome.deleteOnExit() project.slice.iceHome = tmpIceHome.toString() try { def iceHome = project.slice.iceHome fail() } catch (e) { // This should throw an exception since /dev/null is not a valid iceHome location. slice2java is missing } } @Test public void testIceHomeWithNoSlice2Java() { // // Test that if iceHome is a srcDist and slice2java is missing that we can still // initialize (at least partially) the configuration without failure // // Create temporary iceHome with fake structure that slice extension requires def tmpIceHome = File.createTempDir() tmpIceHome.deleteOnExit() def tmpBuildGralde = new File([tmpIceHome.toString(), "java", "build.gradle"].join(File.separator)) tmpBuildGralde.mkdirs() tmpBuildGralde.deleteOnExit() assertTrue(tmpBuildGralde.exists()) project.slice.iceHome = tmpIceHome.toString() assertTrue(project.slice.iceHome == tmpIceHome.toString()) assertTrue(project.slice.srcDist == true) assertTrue(project.slice.iceVersion == null) assertTrue(project.slice.sliceDir == null) assertTrue(project.slice.jarDir == null) } @Test public void testCppPlatformAndConfigurationFromEnvironment() { environmentVariables.set("CPP_CONFIGURATION", "Release"); environmentVariables.set("CPP_PLATFORM", "Win32"); forceReinitialization() assertTrue(project.slice.cppConfiguration == "Release") assertTrue(project.slice.cppPlatform == "Win32") } @Test public void testCppPlatformAndConfiguration() { project.slice { cppConfiguration = "Debug" cppPlatform = "x64" } assertTrue(project.slice.cppConfiguration == "Debug") assertTrue(project.slice.cppPlatform == "x64") } @Test public void testCppPlatformAndConfigurationOverrideEnvironment() { environmentVariables.set("CPP_CONFIGURATION", "Release"); environmentVariables.set("CPP_PLATFORM", "Win32"); forceReinitialization() project.slice { cppConfiguration = "Debug" cppPlatform = "x64" } assertTrue(project.slice.cppConfiguration == "Debug") assertTrue(project.slice.cppPlatform == "x64") } } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/SlicePluginVersionTest.groovyice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/SlicePluginVersionTest.gr0000664000175000017500000000351613233633150032246 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice import org.junit.Test import static org.junit.Assert.assertEquals import static org.junit.Assume.assumeNotNull // // Test version comparsions // // 1 is a > b // 0 if a == b // -1 if a < b // class SlicePluginVersionTest extends TestCase { @Test public void testIceVersionEquals() { assumeNotNull(project.slice.iceVersion) assertEquals(0, project.slice.compareIceVersion(project.slice.iceVersion)) } @Test public void testCompareVersionEquals() { assertEquals(0, SliceExtension.compareVersions("3.7.0", "3.7.0")) } @Test public void testCompareMajorVersionEquals() { assertEquals(0, SliceExtension.compareVersions("3.7", "3.7")) } @Test public void testCompareVersionPointRelase() { assertEquals(-1, SliceExtension.compareVersions("3.7.0", "3.7.1")) } @Test public void testCompareVersionLess() { assertEquals(-1, SliceExtension.compareVersions("3.6.0", "3.7.0")) } @Test public void testCompareVersionGreater() { assertEquals(1, SliceExtension.compareVersions("3.7.0", "3.6.0")) } // Common indices match. Assume the longest version is the most recent @Test public void testCompareVersionLength() { assertEquals(-1, SliceExtension.compareVersions("3.7", "3.7.0")) } @Test public void testCompareVersionLengthGreater() { assertEquals(1, SliceExtension.compareVersions("3.7", "3.6.0")) } @Test public void testCompareVersionLengthLess() { assertEquals(-1, SliceExtension.compareVersions("3.6.0", "3.7")) } } ice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/TestCase.groovy0000664000175000017500000000300413233633150030242 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice import org.gradle.testfixtures.ProjectBuilder import org.junit.After import org.junit.Before import static org.junit.Assume.assumeNoException import static org.junit.Assume.assumeNotNull class TestCase { def project = null @Before void createProject() { project = ProjectBuilder.builder().build() project.pluginManager.apply 'java' project.pluginManager.apply 'slice' } @Before void checkIceInstalled() { // try { assumeNotNull(project.slice.iceHome) assumeNotNull(project.slice.slice2java) // } catch (org.gradle.api.GradleException e) { // assumeNoException(e); // } } @After public void cleanupProject() { project.delete() project = null } def newProjectWithProjectDir() { def p = ProjectBuilder.builder().withProjectDir(project.rootDir).build() p.pluginManager.apply 'java' p.pluginManager.apply 'slice' return p } void forceReinitialization() { // setting any variable forces reinitialization def iceHome = project.slice.iceHome project.slice.iceHome = iceHome } def pathToFile(pathList) { return new File(pathList.join(File.separator)) } } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/Slice2JavaCompatDefine.groovyice-builder-gradle-1.4.5/src/test/groovy/com/zeroc/gradle/icebuilder/slice/Slice2JavaCompatDefine.gr0000664000175000017500000000333613233633150032024 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice import org.junit.Before import org.junit.Test import static org.junit.Assert.assertTrue import static org.junit.Assume.assumeTrue class Slice2JavaCompatDefine extends TestCase { @Before public void checkVersion() { // For what we are testing our ice version must be < 3.7 assumeTrue(project.slice.compareIceVersion('3.7') == -1) } @Test public void testSlice2JavaCompatDefine() { // Where builder checks for slice files by default pathToFile([project.rootDir, 'src', 'main', 'slice']).mkdirs() writeTestSliceToFile(pathToFile([project.rootDir, 'src', 'main', 'slice', 'Test.ice'])) project.tasks.compileSlice.execute() assertTrue(pathToFile([project.rootDir, 'build', 'generated-src', 'com', 'zeroc', 'Test', 'Hello.java']).exists()) } private void writeTestSliceToFile(file) { file << """ |#ifdef __SLICE2JAVA_COMPAT__ |[[\"java:package:com.zeroc\"]] [[\"java:package:com.zeroc\"]] |#endif | |module Test |{ | |interface Hello |{ | idempotent void sayHello(int delay); | void shutdown(); |}; | |}; """.stripMargin() } } ice-builder-gradle-1.4.5/src/main/0000775000175000017500000000000013233633150015337 5ustar josejoseice-builder-gradle-1.4.5/src/main/resources/0000775000175000017500000000000013233633150017351 5ustar josejoseice-builder-gradle-1.4.5/src/main/resources/META-INF/0000775000175000017500000000000013233633150020511 5ustar josejoseice-builder-gradle-1.4.5/src/main/resources/META-INF/gradle-plugins/0000775000175000017500000000000013233633150023426 5ustar josejoseice-builder-gradle-1.4.5/src/main/resources/META-INF/gradle-plugins/slice.properties0000664000175000017500000000010313233633150026635 0ustar josejoseimplementation-class=com.zeroc.gradle.icebuilder.slice.SlicePlugin ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootice-builder-gradle-1.4.5/src/main/resources/META-INF/gradle-plugins/com.zeroc.gradle.ice-builder.slice.propertiesice-builder-gradle-1.4.5/src/main/resources/META-INF/gradle-plugins/com.zeroc.gradle.ice-builder.sli0000664000175000017500000000010313233633150031450 0ustar josejoseimplementation-class=com.zeroc.gradle.icebuilder.slice.SlicePlugin ice-builder-gradle-1.4.5/src/main/groovy/0000775000175000017500000000000013233633150016664 5ustar josejoseice-builder-gradle-1.4.5/src/main/groovy/com/0000775000175000017500000000000013233633150017442 5ustar josejoseice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/0000775000175000017500000000000013233633150020564 5ustar josejoseice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/0000775000175000017500000000000013233633150022022 5ustar josejoseice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/0000775000175000017500000000000013233633150024131 5ustar josejoseice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/slice/0000775000175000017500000000000013233633150025230 5ustar josejoseice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/slice/package-info.groovy0000664000175000017500000000005213233633150031020 0ustar josejosepackage com.zeroc.gradle.icebuilder.slice ice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/slice/SliceTask.groovy0000664000175000017500000006477213233633150030401 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice import org.gradle.api.DefaultTask import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.OutputDirectory import org.gradle.api.GradleException import java.io.* import org.slf4j.Logger import org.slf4j.LoggerFactory import groovy.util.XmlSlurper import groovy.xml.MarkupBuilder class SliceTask extends DefaultTask { private static final Logger LOGGER = LoggerFactory.getLogger(SliceTask) SliceTask() { // This forces the task to run on each build rather than relying on a hash // of the input files. outputs.upToDateWhen { false } } @TaskAction def action() { if(!project.slice.output.isDirectory()) { if(!project.slice.output.mkdirs()) { throw new GradleException("could not create slice output directory: ${project.slice.output}") } } // // In case the slice output directory is not inside the buildDir, as we still store // dependency files here // if(!project.buildDir.isDirectory()) { if(!project.buildDir.mkdirs()) { throw new GradleException("could not create build output directory: ${project.buildDir}") } } // Make sure default source set is present if(project.slice.java.isEmpty()) { project.slice.java.create("default") } processJava() processFreezeJ() } @InputFiles def getInputFiles() { return [] } @OutputDirectory def getOutputDirectory() { return project.slice.output } def processFreezeJ() { def freezej = project.slice.freezej // Set of source files and all dependencies. Set files = [] if(freezej.files) { files.addAll(freezej.files) getS2FDependencies(freezej).values().each({ files.addAll(it) }) } def state = new FreezeJBuildState() def stateFile = new File(project.slice.output, "slice2freezej.df.xml") state.read(stateFile) def rebuild = false def args = buildS2FCommandLine(freezej) // If the command line changes or the slice2freezej compiler (always the first argument) // has been updated then rebuild. if(args != state.args || getTimestamp(new File(args[0])) > state.timestamp) { rebuild = true } // Rebuild if the set of slice files has changed, or if one of the slice files has a timestamp newer // than the last build. if(!rebuild && state.slice.size() != files.size()) { rebuild = true } // If the build timestamp is older than the slice file timestamp then we need to build the source file. if(!rebuild) { rebuild = files.any { getTimestamp(it) > state.timestamp } } // Check if the prior set of slice files has changed. if(!rebuild) { rebuild = state.slice.any { !files.contains(it) } } // Check that any previously generated files still exist if(!rebuild) { rebuild = state.generated.any { generatedFile -> !generatedFile.isFile() || getTimestamp(generatedFile) > state.timestamp } } // Bail out if there is nothing to do (in theory this should not occur). if(!rebuild) { LOGGER.info("nothing to do") return } if(freezej.files) { LOGGER.info("running slice2freezej on the following slice files") freezej.files.each { LOGGER.info(" ${it}") } } else if (!stateFile.isFile()) { // The state file has never been written and and we have no // files to process. No reason to continue as it will only // write an empty dependency file. LOGGER.info("nothing to do") return } // List of generated java source files. def generated = executeS2F(freezej) // Gather up the list of source files that we previously built for those files which are building. Set oldGenerated = state.generated // Remove all source files that we have generated from the list of previously built sources. oldGenerated.removeAll(generated) // Update the build state. def newState = new FreezeJBuildState() newState.timestamp = System.currentTimeMillis() newState.slice = files newState.generated = generated newState.args = args // Write the new dependencies file. newState.write(stateFile) deleteFiles(oldGenerated) } def getS2FGenerated(freezej) { def files = [] freezej.dict.each { files.add(it.javaType) } freezej.index.each { files.add(it.javaType) } // Convert each file name from java package convention to file name. files = files.collect { it.tr('.', '/') + ".java" } // Convert to a file with the generated path. files = files.collect { new File(project.slice.output, it) } return files } // Executes slice2freezej to determine the slice file dependencies. // Returns a dictionary of A -> [B] where A depends on B. def getS2FDependencies(freezej) { if((freezej.dict == null || freezej.dict.isEmpty()) && (freezej.index == null || freezej.index.isEmpty())) { // No build artifacts. return [:] } def command = buildS2FCommandLine(freezej) command.add("--depend-xml") freezej.files.each { command.add(it.getAbsolutePath() ) } LOGGER.info("processing dependencies:\n${command}") def sout = new StringBuffer() def serr = new StringBuffer() def p = command.execute(project.slice.env, null) p.waitForProcessOutput(sout, serr) printWarningsAndErrors(serr) if (p.exitValue() != 0) { throw new GradleException("${command[0]} failed with exit code: ${p.exitValue()}") } return parseSliceDependencyXML(new XmlSlurper().parseText(sout.toString())) } // Run slice2freezej. Returns a dictionary of A -> [B] where A is a slice file, and B is the list of // generated java source files. def executeS2F(freezej) { if((freezej.dict == null || freezej.dict.isEmpty()) && (freezej.index == null || freezej.index.isEmpty())) { // No build artifacts. return [:] } def command = buildS2FCommandLine(freezej) freezej.files.each { command.add(it.getAbsolutePath() ) } LOGGER.info("processing slice:\n${command}") def sout = new StringBuffer() def serr = new StringBuffer() def p = command.execute(project.slice.env, null) p.waitForProcessOutput(sout, serr) printWarningsAndErrors(serr) if (p.exitValue() != 0) { throw new GradleException("${command[0]} failed with exit code: ${p.exitValue()}") } return getS2FGenerated(freezej) } def buildS2FCommandLine(freezej) { def command = [] command.add(project.slice.slice2freezej) command.add("--output-dir=" + project.slice.output.getAbsolutePath()) if (project.slice.sliceDir) { command.add("-I${project.slice.sliceDir}") } freezej.include.each { command.add('-I' + it) } freezej.args.split().each { command.add(it) } freezej.dict.each { def javaType = it.javaType command.add("--dict") command.add(javaType + "," + it.key + "," + it.value) it.index.each { command.add("--dict-index") def buf = new StringBuffer() buf << javaType if(it.containsKey('member')) { buf << ',' buf << it['member'] } if(it.containsKey('caseSensitive')) { buf << ',' if(it['caseSensitive']) { buf << "case-sensitive" }else { buf << "case-insensitive" } } command.add(buf.toString()) } } freezej.index.each { command.add("--index") def buf = new StringBuffer() buf << it.javaType buf << ',' buf << it.type buf << ',' buf << it.member buf << ',' if(it.caseSensitive) { buf << "case-sensitive" }else { buf << "case-insensitive" } command.add(buf.toString()) } return command } // Process the written slice file which is of the format: // // // // // // // // class FreezeJBuildState { // Timestamp of last build in milliseconds. def timestamp // List of slice files. def slice = [] // List of generated source files. def generated = [] // List of command line arguments. def args = [] def write(stateFile) { def writer = new StringWriter() def xml = new MarkupBuilder(writer) xml.state { xml.timestamp("value": timestamp) args.each { xml.arg("value": it) } slice.each { xml.slice("name": it) } generated.each { xml.generated("name": it) } } stateFile.write(writer.toString()) } def read(stateFile) { if(!stateFile.isFile()) { return } try { def xml = new XmlSlurper().parse(stateFile) if(xml.name() != "state") { throw new GradleException("malformed XML: expected `state'") } xml.children().each { if(it.name() == "arg") { args.add(it.attributes().get("value")) } else if(it.name() == "timestamp") { timestamp = it.attributes().get("value").toLong() } else if(it.name() == "slice") { slice.add(new File(it.attributes().get("name"))) } else if(it.name() == "generated") { generated.add(new File(it.attributes().get("name"))) } } } catch(Exception ex) { LOGGER.info("invalid XML: ${stateFile}") println ex } } } def processJava() { // Dictionary of A->[B] where A is a slice file and B is the list of generated // source files. def generated = [:] // Set of slice files processed. Set built = [] // Complete set of slice files. Set files = [] def stateFile = new File(project.slice.output, "slice2java.df.xml") // Dictionary of A->[B] where A is the source set name and B is // the JavaSourceSet def sourceSet = [:] // Dictionary of A->[B] where B depends on A for the java task. def s2jDependencies = [:] def state = new JavaBuildState() state.read(stateFile) project.slice.java.each { it.args = it.args.stripIndent() if (it.files == null) { it.files = project.fileTree(dir: it.srcDir).include('**/*.ice') } it.files.each { if(files.contains(it)) { throw new GradleException("${it}: input file specified in multiple source sets") } files.add(it) } if(!it.files.isEmpty()) { s2jDependencies << getS2JDependencies(it) } } project.slice.java.each { processJavaSet(it, s2jDependencies, state, generated, built, sourceSet) } if(built.isEmpty() && !stateFile.isFile()) { // The state file has never been written and and we have no // files to process. No reason to continue as it will only // write an empty dependency file. LOGGER.info("nothing to do") return } // The set of generated files to remove. Set oldGenerated = [] // Add all of the previously generated files from the slice files that were // just built in processJavaSet. built.each { def d = state.slice[it] if(d != null) { oldGenerated.addAll(d) } } // Add to the oldGenerated list the generated files for those slice files // no longer are in any source set. state.slice.each { if(!files.contains(it.key)) { oldGenerated.addAll(it.value) } } // Remove all generated files that were just generated in processJavaSet. generated.values().each { oldGenerated.removeAll(it) } def newState = new JavaBuildState() newState.timestamp = System.currentTimeMillis() newState.sourceSet = sourceSet // Update the dependencies. built.each { newState.slice[it] = generated[it] } files.each { if(!built.contains(it)) { newState.slice[it] = state.slice[it] } } // Write the new dependencies file. newState.write(stateFile) deleteFiles(oldGenerated) } def processJavaSet(java, s2jDependencies, state, generated, built, sourceSet) { def ss = new JavaSourceSet() ss.args = buildS2JCommandLine(java) java.files.each { ss.slice.add(it) } sourceSet[java.name] = ss // The JavaSourceSet from the previous build. def prevSS = state.sourceSet[java.name] Set toBuild = [] // If the source set is new, the sourceSet arguments are different, // or the slice2java compiler (always the first argument) has been updated, // then rebuild all slice files. if(prevSS == null || ss.args != prevSS.args || getTimestamp(new File(ss.args[0])) > state.timestamp) { java.files.each { toBuild.add(it) } } else { // s2jDependencies is populated in getInputFiles. java.files.each { sliceFile -> // Build the slice file if it wasn't built before in this source set, // or its timestamp is newer than the last build time, // or any of its dependencies have a timestamp newer than the last build time. if(!prevSS.slice.contains(sliceFile) || (getTimestamp(sliceFile) > state.timestamp) || s2jDependencies[sliceFile].any { dependency -> getTimestamp(dependency) > state.timestamp }) { toBuild.add(sliceFile) } // // Check that any previously generated files still exist // else if(state.slice[sliceFile] != null && state.slice[sliceFile].any { generatedFile -> !generatedFile.isFile() || getTimestamp(generatedFile) > state.timestamp }) { toBuild.add(sliceFile) } } } // Bail out if there is nothing to do (in theory this should not occur) if(toBuild.isEmpty()) { LOGGER.info("nothing to do") return } LOGGER.info("running slice2java on the following slice files") toBuild.each { LOGGER.info(" ${it}") } // Update the set of java source files generated and the slice files processed. generated << executeS2J(java, toBuild) built.addAll(toBuild) } def buildS2JCommandLine(java) { def command = [] command.add(project.slice.slice2java) if (project.slice.sliceDir) { command.add("-I${project.slice.sliceDir}") } java.include.each { command.add('-I' + it) } java.args.split().each { command.add(it) } if(project.slice.compat) { command.add('--compat') } // // If the ice version is less than 3.7 it is still possible that we are compiling // 3.7 slice files. // // compareIceVersion returns -1 if iceVersion < 3.7 // if(project.slice.compareIceVersion('3.7') == -1) { command.add('-D__SLICE2JAVA_COMPAT__') } return command } // Run slice2java. Returns a dictionary of A -> [B] where A is a slice file, // and B is the list of produced java source files. def executeS2J(java, files) { def command = buildS2JCommandLine(java) command.add("--list-generated") command.add("--output-dir=" + project.slice.output.getAbsolutePath()) files.each { command.add(it.getAbsolutePath()) } LOGGER.info("processing slice:\n${command}") def sout = new StringBuffer() def serr = new StringBuffer() def p = command.execute(project.slice.env, null) p.waitForProcessOutput(sout, serr) printWarningsAndErrors(serr, sout) if (p.exitValue() != 0) { throw new GradleException("${command[0]} failed with exit code: ${p.exitValue()}") } return parseGeneratedXML(new XmlSlurper().parseText(sout.toString())) } // Executes slice2java to determine the slice file dependencies. // Returns a dictionary of A -> [B] where A depends on B. def getS2JDependencies(java) { def command = buildS2JCommandLine(java) command.add("--depend-xml") java.files.each { command.add(it.getAbsolutePath() ) } LOGGER.info("processing dependencies:\n${command}") def sout = new StringBuffer() def serr = new StringBuffer() def p = command.execute(project.slice.env, null) p.waitForProcessOutput(sout, serr) printWarningsAndErrors(serr) if (p.exitValue() != 0) { throw new GradleException("${command[0]} failed with exit code: ${p.exitValue()}") } LOGGER.info("processing dependencies:\n${command}") return parseSliceDependencyXML(new XmlSlurper().parseText(sout.toString())) } // Cache of file -> timestamp. def timestamps = [:] // Get the last modified time for the file. Note that this time is in ms. def getTimestamp(file) { if(timestamps.containsKey(file)) { return timestamps[file] } if(!file.isFile()) { throw new GradleException("${file}: cannot stat") } def t = file.lastModified() timestamps[file] = t return t } class JavaSourceSet { // List of slice files. def slice = [] // List of arguments. def args = [] } // Process the written slice file which is of the format: // // // // // // // // // // // // class JavaBuildState { // Timestamp of last build in milliseconds. def timestamp // List of slice files. Dictionary of A -> [B] where B is the list of generated java // source files. def slice = [:] // Dictionary of source set -> JavaSourceSet def sourceSet = [:] def write(stateFile) { def writer = new StringWriter() def xml = new MarkupBuilder(writer) xml.state { xml.timestamp("value": timestamp) sourceSet.each { def key = it.key def value = it.value xml.sourceSet("name": key) { value.slice.each { def file = it xml.source("name": file) { slice[file].each { xml.file("name": it) } } } value.args.each { xml.arg("value": it) } } } } stateFile.write(writer.toString()) } def read(stateFile) { if(!stateFile.isFile()) { return } try { def xml = new XmlSlurper().parse(stateFile) if(xml.name() != "state") { throw new GradleException("malformed XML: expected `state'") } xml.children().each { if(it.name() == "timestamp") { timestamp = it.attributes().get("value").toLong() } else if(it.name() == "sourceSet") { def ss = new JavaSourceSet() def name = it.attributes().get("name") it.children().each { if(it.name() == "arg") { ss.args.add(it.attributes().get("value")) } else if(it.name() == "source") { def source = new File(it.attributes().get("name")) def files = [] it.children().each { if(it.name() == "file") { files.add(new File(it.attributes().get("name"))) } } slice[source] = files ss.slice.add(source) } } sourceSet[name] = ss } } } catch(Exception ex) { LOGGER.error("invalid XML: ${stateFile}") LOGGER.error(ex) } } } // Process the generated XML which is of the format: // // // // // // def parseGeneratedXML(xml) { if(xml.name() != "generated") { throw new GradleException("malformed XML: expected `generated'") } def generated =[:] xml.children().each { if(it.name() == "source") { def source = it.attributes().get("name") def files = [] it.children().each { if(it.name() == "file") { files.add(new File(it.attributes().get("name"))) } } generated.put(new File(source), files) } } return generated } // Parse the dependency XML which is of the format: // // // // // // // // def parseSliceDependencyXML(xml) { if(xml.name() != "dependencies") { throw new GradleException("malformed XML") } def dependencies =[:] xml.children().each { if(it.name() == "source") { def source = it.attributes().get("name") def files = [] it.children().each { if(it.name() == "dependsOn") { def dependsOn = new File(it.attributes().get("name")) files.add(dependsOn) } } dependencies.put(new File(source), files) } } return dependencies } def deleteFiles(files) { if(!files.isEmpty()) { LOGGER.info("the following generated java source files will be deleted") files.each { LOGGER.info(" ${it}") } String buildDirPath = project.slice.output.getPath() files.each { String parent = it.getParent() if(!parent.startsWith(buildDirPath)) { LOGGER.info("not removing ${it} as it is outside the build dir ${buildDirPath}") } else { it.delete() } } } } def printWarningsAndErrors(serr, sout = null) { def lineSep = System.getProperty("line.separator") def errLines = serr.toString().split(lineSep).findAll { !it.trim().isEmpty() } def outLines = [] // // stdout is always xml // if(sout) { def xml = new XmlSlurper().parseText(sout.toString()) if(xml.name() != "generated") { throw new GradleException("malformed XML: expected `generated'") } xml.children().each { if(it.name() == "source") { it.children().each { if(it.name() == "output") { def lines = it.text().split(lineSep).findAll { !it.trim().isEmpty() } outLines.addAll(lines) } } } } } def warningMatch = /(.*):[0-9]+:\s+warning:(.*)/ for(line in errLines + outLines) { switch(line) { case ~warningMatch: LOGGER.warn(line.trim()) break default: // These should all be errors LOGGER.error(line.trim()) break } } } } ice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/slice/Java.groovy0000664000175000017500000000063713233633150027366 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice; class Java { def name def args = "" def files def srcDir = "src/main/slice" def include Java(String n) { name = n; } } ice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/slice/SliceExtension.groovy0000664000175000017500000003657113233633150031447 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice; import org.gradle.api.GradleException import org.gradle.api.logging.Logging import org.gradle.api.NamedDomainObjectContainer class SliceExtension { final NamedDomainObjectContainer java; private def iceHome = null private def iceVersion = null private def iceArtifactVersion = null private def srcDist = false private def freezeHome = null private def sliceDir = null private def slice2java = null private def slice2freezej = null private def jarDir = null private def cppPlatform = null private def cppConfiguration = null private def compat = null private def env = [] private def initialized = false def output private static Configuration configuration = null private static final def LOGGER = Logging.getLogger(SliceExtension) class Configuration { def _iceHome = null def _iceVersion = null def _srcDist = false def _freezeHome = null def _sliceDir = null def _slice2java = null def _slice2freezej = null def _jarDir = null def _cppPlatform = null def _cppConfiguration = null def _compat = null def _env = [] Configuration(iceHome = null, freezeHome = null) { _iceHome = iceHome ?: getIceHome(); _freezeHome = freezeHome // Guess the cpp platform and cpp configuration to use with Windows source builds _cppConfiguration = cppConfiguration ?: System.getenv("CPP_CONFIGURATION") _cppPlatform = cppPlatform ?: System.getenv("CPP_PLATFORM") def os = System.properties['os.name'] if(_iceHome != null) { _srcDist = new File([_iceHome, "java", "build.gradle"].join(File.separator)).exists() _slice2java = getSlice2java(_iceHome) // // If freezeHome is not set we assume slice2freezej resides in the same location as slice2java // otherwise slice2freezej will be located in the freeze home bin directory. // _slice2freezej = getSlice2freezej(_freezeHome ? _freezeHome : _iceHome) // // Setup the environment required to run slice2java/slice2freezej commands // if(os.contains("Linux")) { def cppDir = _srcDist ? "${_iceHome}/cpp" : _iceHome; def libdir = new File("${cppDir}/lib/i386-linux-gnu").exists() ? "${cppDir}/lib/i386-linux-gnu" : "${cppDir}/lib" def lib64dir = new File("${cppDir}/lib/x86_64-linux-gnu").exists() ? "${cppDir}/lib/x86_64-linux-gnu" : "${cppDir}/lib64" def env = [libdir, lib64dir] if(System.env.LD_LIBRARY_PATH) { env.add(System.env.LD_LIBRARY_PATH) } _env = ["LD_LIBRARY_PATH=${env.join(File.pathSeparator)}"] } // // Retrieve the version of the Ice distribution being used // _iceVersion = getIceVersion(_iceHome) // // This can only happen if iceHome is set to a source distribution. In this case we log a warning // and return partially initialized. We DO NOT want to throw an exception because we could be in the // middle of a clean, in which case slice2java will be missing. // if(!_iceVersion) { LOGGER.warn("Unable to determine the Ice version using slice2java (${slice2java}) from " + "iceHome (${iceHome}). This is expected when cleaning.") return } // // --compat only available for Ice 3.7 and higher // if(SliceExtension.compareVersions(_iceVersion, '3.7') >= 0) { _compat = compat ?: false } else if(compat != null) { LOGGER.warn("Property \"slice.compat\" unavailable for Ice ${_iceVersion}.") } // // Guess the slice and jar directories of the Ice distribution we are using // def sliceDirectories = [ [_iceHome, "share", "slice"], // Common shared slice directory [_iceHome, "share", "ice", "slice"], // Ice >= 3.7 [_iceHome, "share", "Ice-${_iceVersion}", "slice"], // Ice < 3.7 [_iceHome, "slice"] // Opt/source installs & Windows distribution ] def jarDirectories = [ [_iceHome, "share", "java"], // Default usr install [_iceHome, _compat ? "java-compat" : "java", "lib"], // Source distribution [_iceHome, "lib"] // Opt style install & Windows distribution ] def sliceDirCandidates = sliceDirectories.collect { it.join(File.separator) } def jarDirCandidates = jarDirectories.collect { it.join(File.separator) } _sliceDir = sliceDirCandidates.find { new File(it).exists() } _jarDir = jarDirCandidates.find { new File(it).exists() } if (!_sliceDir) { LOGGER.warn("Unable to locate slice directory in iceHome (${iceHome})") } } } def getIceHome() { if (System.env.ICE_HOME != null) { return System.env.ICE_HOME } def os = System.properties['os.name'] if (os == "Mac OS X") { return "/usr/local" } else if (os.contains("Windows")) { return getWin32IceHome() } else { return "/usr" } } // // Query Win32 registry key and return the InstallDir value for the given key // def getWin32InstallDir(key) { def sout = new StringBuffer() def serr = new StringBuffer() def p = ["reg", "query", key, "/v", "InstallDir"].execute() p.waitForProcessOutput(sout, serr) if (p.exitValue() != 0) { return null } return sout.toString().split(" ")[3].trim() } // // Query Win32 registry and return the path of the latest Ice version available. // def getWin32IceHome() { def sout = new StringBuffer() def serr = new StringBuffer() def p = ["reg", "query", "HKLM\\Software\\ZeroC"].execute() p.waitForProcessOutput(sout, serr) if (p.exitValue() != 0) { // // reg query will fail if Ice is not installed // return "" } def iceInstallDir = null def iceVersion = null sout.toString().split("\\r?\\n").each { try{ if (it.indexOf("HKEY_LOCAL_MACHINE\\Software\\ZeroC\\Ice") != -1) { def installDir = getWin32InstallDir(it) if (installDir != null) { def version = getIceVersion(installDir) if(iceVersion == null || compareVersions(version, iceVersion) == 1) { iceInstallDir = installDir iceVersion = version } } } } catch(e){ } } return iceInstallDir } def getIceVersion(iceHome) { def slice2java = getSlice2java(iceHome) if(new File(slice2java).exists()) { def command = [slice2java, "--version"] def sout = new StringBuffer() def serr = new StringBuffer() def p = command.execute(_env, null) p.waitForProcessOutput(sout, serr) if (p.exitValue() != 0) { println serr.toString() throw new GradleException("${command[0]} command failed: ${p.exitValue()}") } return serr.toString().trim() } else if(!_srcDist) { // Only throw an exception if we are not using a source distribution. A binary distribution should // always have slice2java, howerver a source distribution may not. For example, during a clean. throw new GradleException("slice2java (${slice2java}) not found. Please ensure that Ice is installed " + "and the iceHome property (${iceHome}) is correct.") } else { return null; } } def getSlice2java(iceHome) { return getSliceCompiler("slice2java", iceHome) } def getSlice2freezej(freezeHome) { return getSliceCompiler("slice2freezej", freezeHome) } // // Return the path to the specified slice compiler (slice2java|slice2freezej) with respect to // the specified homeDir (iceHome|freezeHome) // def getSliceCompiler(name, homeDir) { def os = System.properties['os.name'] // // Check if we are using a Slice source distribution // def srcDist = new File([homeDir, "java", "build.gradle"].join(File.separator)).exists() def compilerName = os.contains('Windows') ? "${name}.exe" : name def sliceCompiler = null // // Set the location of the sliceCompiler executable // if (os.contains("Windows")) { // // For Windows source distribution we first check for \cpp\bin\\ // that correspond with Ice 3.7 or greater source distribution. /// // For Windows binary distribution we first check for \tools that correspond with NuGet package // layout. // def basePath = srcDist ? [homeDir, "cpp", "bin", _cppPlatform, _cppConfiguration] : [homeDir, "tools"] basePath = basePath.join(File.separator) if(new File(basePath).exists()) { sliceCompiler = [basePath, compilerName].join(File.separator) } } if (sliceCompiler == null) { sliceCompiler = srcDist ? [homeDir, "cpp", "bin", compilerName].join(File.separator) : [homeDir, "bin", compilerName].join(File.separator) } return sliceCompiler } } SliceExtension(java) { this.java = java } def java(Closure closure) { try { java.configure(closure) } catch(MissingPropertyException ex) { java.create('default', closure) } } private def parseVersion(v) { if(v) { def vv = v.tokenize('.') if(v.indexOf('a') != -1) { return "${vv[0]}.${vv[1].replace('a', '.0-alpha')}" } else if (v.indexOf('b') != -1) { return "${vv[0]}.${vv[1].replace('b', '.0-beta')}" } else { return v } } else { return null; } } private void init() { LOGGER.debug('Initializing configuration') initialized = true // must happen before calling setters Configuration c = new Configuration(iceHome, freezeHome) iceHome = c._iceHome iceVersion = c._iceVersion iceArtifactVersion = parseVersion(c._iceVersion) srcDist = c._srcDist freezeHome = c._freezeHome sliceDir = c._sliceDir slice2java = c._slice2java slice2freezej = c._slice2freezej jarDir = c._jarDir cppPlatform = c._cppPlatform cppConfiguration = c._cppConfiguration compat = c._compat env = c._env LOGGER.debug("Property: iceHome = ${iceHome}") LOGGER.debug("Property: iceVersion = ${iceVersion}") LOGGER.debug("Property: srcDist = ${srcDist}") LOGGER.debug("Property: freezeHome = ${freezeHome}") LOGGER.debug("Property: sliceDir = ${sliceDir}") LOGGER.debug("Property: slice2java = ${slice2java}") LOGGER.debug("Property: slice2freezej = ${slice2freezej}") LOGGER.debug("Property: jarDir = ${jarDir}") LOGGER.debug("Property: cppPlatform = ${cppPlatform}") LOGGER.debug("Property: cppConfiguration = ${cppConfiguration}") LOGGER.debug("Property: compat = ${compat}") LOGGER.debug("Property: env = ${env}") assert initialized == true } // 1 is a > b // 0 if a == b // -1 if a < b static def compareVersions(a, b) { def verA = a.tokenize('.') def verB = b.tokenize('.') for (int i = 0; i < Math.min(verA.size(), verB.size()); ++i) { if (verA[i] != verB[i]) { return verA[i] <=> verB[i] } } // Common indices match. Assume the longest version is the most recent verA.size() <=> verB.size() } // Compare iceVersion with version // 1 is iceVersion > version // 0 if iceVersion == version // -1 if iceVersion < version def compareIceVersion(version) { lazyInit() return compareVersions(iceVersion, version) } def getIceHome() { lazyInit() return iceHome } def setIceHome(value) { iceHome = value initialized = false } def getIceVersion() { lazyInit() return iceVersion } def getIceArtifactVersion() { lazyInit() return iceArtifactVersion } def getSrcDist() { lazyInit() return srcDist } def getFreezeHome() { lazyInit() return freezeHome } def setFreezeHome(value) { freezeHome = value initialized = false } def getSliceDir() { lazyInit() return sliceDir } def getSlice2java() { lazyInit() return slice2java } def getSlice2freezej() { lazyInit() return slice2freezej } def getJarDir() { lazyInit() return jarDir } def getCppPlatform() { lazyInit() return cppPlatform } def setCppPlatform(value) { cppPlatform = value initialized = false } def getCppConfiguration() { lazyInit() return cppConfiguration } def setCppConfiguration(value) { cppConfiguration = value initialized = false } def getCompat() { lazyInit() return compat } def setCompat(value) { compat = value initialized = false } def getEnv() { lazyInit() return env } def lazyInit() { if(!initialized) { init() } } } ice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/slice/Freezej.groovy0000664000175000017500000000133513233633150030073 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice; import org.gradle.api.NamedDomainObjectContainer class Freezej { final NamedDomainObjectContainer dict; final NamedDomainObjectContainer index; def name def args = "" def files def srcDir def include Freezej(dict, index) { this.dict = dict this.index = index } def dict(Closure closure) { dict.configure(closure) } def index(Closure closure) { index.configure(closure) } } ice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/slice/Dict.groovy0000664000175000017500000000064613233633150027370 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice; class Dict { def name def javaType def key def value // list of dictionary values def index Dict(String n) { name = n } } ice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/slice/Index.groovy0000664000175000017500000000063013233633150027545 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice; class Index { def name def javaType def type def member def caseSensitive = true Index(String n) { name = n } } ice-builder-gradle-1.4.5/src/main/groovy/com/zeroc/gradle/icebuilder/slice/SlicePlugin.groovy0000664000175000017500000000447513233633150030727 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** package com.zeroc.gradle.icebuilder.slice; import org.gradle.api.logging.Logging import org.gradle.api.NamedDomainObjectContainer import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.UnknownTaskException class SlicePlugin implements Plugin { private static final def LOGGER = Logging.getLogger(SliceTask) void apply(Project project) { project.task('compileSlice', type: SliceTask) { group = "Slice" } // Create and install the extension object. project.extensions.create("slice", SliceExtension, project.container(Java)) project.extensions.slice.extensions.create("freezej", Freezej, project.container(Dict), project.container(Index)) project.slice.output = project.file("${project.buildDir}/generated-src") // Android projects do not define a 'compileJava' task. We wait until the project is evaluated // and add our dependency to the variant's javaCompiler task. if(isAndroidProject(project)) { LOGGER.debug("Detected Android project: ${project}. Delaying applying task until project is evaluated") project.afterEvaluate { getAndroidVariants(project).all { variant -> variant.registerJavaGeneratingTask(project.tasks.getByName('compileSlice'), project.slice.output) } } } else { project.tasks.getByName("compileJava").dependsOn('compileSlice'); project.sourceSets.main.java.srcDir project.slice.output } } def isAndroidProject(Project project) { return project.hasProperty('android') && project.android.sourceSets } def getAndroidVariants(Project project) { // https://sites.google.com/a/android.com/tools/tech-docs/new-build-system/user-guide return project.android.hasProperty('libraryVariants') ? project.android.libraryVariants : project.android.applicationVariants } } ice-builder-gradle-1.4.5/settings.gradle0000664000175000017500000000036213233633150016645 0ustar josejose// ********************************************************************** // // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** rootProject.name = "slice" ice-builder-gradle-1.4.5/README.md0000664000175000017500000004432213233633150015110 0ustar josejose[![Build Status](https://travis-ci.org/zeroc-ice/ice-builder-gradle.svg)](https://travis-ci.org/zeroc-ice/ice-builder-gradle) # Ice Builder for Gradle The Ice Builder for Gradle provides a Gradle plug-in named `slice`. This plug-in manages the compilation of [Slice][1] files to Java. It compiles your Slice files with [`slice2java`][2], and it is also capable of generating Freeze maps and indices with [`slice2freezej`][3]. An [Ice][4] installation with `slice2java` version 3.5.1 or higher is required. ## Contents - [Build Instructions](#build-instructions) - [Using the `slice` Plug-In](#using-the-slice-plug-in) - [Gradle Task](#gradle-task) - [Project Layout](#project-layout) - [Convention Properties](#convention-properties) - [Configuring Slice-to-Java Projects](#configuring-slice-to-java-projects) - [java Properties](#java-properties) - [java Examples](#java-examples) - [Configuring Slice-to-FreezeJ Projects](#configuring-slice-to-freezej-projects) - [freezej Properties](#freezej-properties) - [dict Block](#dict-block) - [dict Properties](#dict-properties) - [dict Examples](#dict-examples) - [index Block](#index-block) - [index Properties](#index-properties) - [index Example](#index-example) - [When does the Plug-In Recompile Slice Files?](#when-does-the-plug-in-recompile-slice-files) ## Build Instructions To build the `slice` plug-in run: ```shell ./gradlew build ``` ## Using the slice Plug-in Build script snippet for use in all Gradle versions: ```gradle buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath "gradle.plugin.com.zeroc.gradle.ice-builder:slice:1.4.5" } } apply plugin: "com.zeroc.gradle.ice-builder.slice" ``` Build script snippet for new, incubating, plugin mechanism introduced in Gradle 2.1: ``` plugins { id "com.zeroc.gradle.ice-builder.slice" version "1.4.5" } ``` It is important that the `slice` plug-in is applied after the `java` plug-in in order for task dependencies to be properly setup. ### Gradle Task The `slice` plug-in adds a task to your project, as shown below: | Task name | Type | Description | | ------------ | --------- | --------------------------------------- | | compileSlice | SliceTask | Generates Java source from Slice files. | The plug-in adds the following dependency to tasks added by the `java` plug-in: | Task name | Depends On | | ----------- | ------------ | | compileJava | compileSlice | On Android, it adds the following dependency to each build variant of `project.android.libraryVariants`, `project.android.applicationVariants`, and `project.android.testVariants`: | Task name | Depends On | | ------------ | ------------ | | javaCompiler | compileSlice | ### Project Layout The plug-in assumes the following project layout: | Directory | Meaning | | -------------- | ------------------------------------------- | | src/main/slice | Location of your project's Slice files. | This default layout can be changed with the property `srcDir`, described below. ### Convention Properties The `slice` plug-in defines the following convention properties: | Property name | Type | Default value | Description | | ----------------- | ------- | ------------------------------------------------ | --------------------------------------------- | | iceHome | String | (see below) | The root directory of the Ice installation. | | freezeHome | String | `iceHome` | The root directory of the Freeze installation. | | output | File | _buildDir_/generated-src | The directory that contains the generated source files. | | iceVersion | String | | The Ice version returned by slice2java -v (read only). | | iceArtifactVersion| String | | The version of the Ice JAR file. This version is computed from `iceVersion` and has usually the same value (read only). | | srcDist | Boolean | | True when using a source distribution for Ice, false otherwise (read only). | | sliceDir | String | (platform dependent) | The Ice Slice installation directory (read only). | | jarDir | String | (platform dependent) | The Ice JARs installation directory (read only and can be null). | | slice2java | String | (platform dependent) | Full path of the slice2java compiler (read only). | | slice2freezej | String | (platform dependent) | Full path of the slice2freezej compiler (read only). | | cppPlatform | String | CPP\_PLATFORM env variable, if set | See note below. | | cppConfiguration | String | CPP\_CONFIGURATION env variable, if set | See note below. | | compat | Boolean | `false` if `iceVersion` >= 3.7, otherwise `null` | When `iceVersion` >= 3.7, adds `--compat` to the slice2java arguments. | If `iceHome` is not set, the plug-in will check the `ICE_HOME` environment variable to determine the location of the Ice installation. If `ICE_HOME` is not set either, the plug-in uses the following defaults on Linux and macOS: | OS | Default Ice Installation Directory | | ---------- | -------------------------------------- | | Linux | /usr | | macOS | /usr/local | On Windows, when neither `iceHome` nor `ICE_HOME` are set, the builder queries the Windows registry to find Ice installations and selects the newest version. You can set `iceHome` in your build script as shown below: ```gradle slice.iceHome = '/opt/Ice' ``` The slice plug-in usually finds the `slice2java` compiler in the `bin` directory of `iceHome`. On Windows, it prefers the following folders before falling back to `bin`: * `iceHome`\\cpp\\bin\\`cppPlatform`\\`cppConfiguration` when `srcDist` is true and cpp\\bin\\`cppPlatform`\\`cppConfiguration` folder exists (this corresponds to the layout of a source distribution for Ice version 3.7 or greater). * `iceHome`\\tools when `srcDist` is false and the `tools` folder exists (this corresponds to the layout of a NuGet package). The slice plug-in uses the same logic to locate the `slice2freezej` compiler within `freezeHome`. ### Slice Plugin Methods | Method Name | Arugment(s) | Description | | ----------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | compareIceVersion | `String` | Compares `iceVersion` with given string. Returns `-1`, `0`, or `1`, depending on whether `iceVersion` is less than, equal to, or greater than given string, respectively. | ### Configuring Slice-to-Java Projects Use the `java` block to configure the compilation of Slice files with `slice2java`. The `java` block can contain one or more source sets, each with its own set of flags for compiling Slice files. You can omit the source set name when you have a single set: ```gradle slice { java { ... } } ``` Otherwise, the source sets must have unique names, for example: ```gradle slice { java { set1 { ... } set2 { ... } } } ``` Each source set triggers a separate execution of the `slice2java` compiler. #### `java` Properties Each source set in the `java` block defines the following convention properties: | Property name | Type | Default value | Description | | ------------- | -------------- | :------------: | ------------------------------------------------------- | | srcDir | File | src/main/slice | The Slice file source directory. | | args | String | - | The arguments to slice2java. | | files | FileCollection | - | The Slice files in this source set. Overrides `srcDir`. | | include | Set | - | Slice include file search path. | Refer to the [slice2java Command-Line Options][2] for a description of the options you can provide through the `args` property. Note: the `slice` directory of your Ice installation (`${slice.iceHome}/slice`) is automatically added to `include` by the plug-in. #### `java` Examples Compile all Slice files in `src/main/slice` with the `--tie` argument: ```gradle slice { java { args = "--tie" } } ``` Compile `a.ice` with the argument `--stream`, and compile all Slice files in `b` without `--stream`. Both compilations add `${projectDir}` to the Slice include search path: ```gradle slice { java { set1 { include = ["${projectDir}"] args = "--stream" files = [file("a.ice")] } set2 { include = ["${projectDir}"] files = fileTree(dir: "b", includes: ['**.ice']) } } } ``` ### Configuring Slice-to-FreezeJ Projects Use the `freezej` block to generate Freeze maps and indices with `slice2freezej`. The plug-in currently supports a single unnamed source set within `freezej`: ``` slice { freezej { srcDir = "src/main/slice" ... } } ``` #### `freezej` Properties Each `freezej` block defines the following convention properties: | Property name | Type | Default value | Description | | ------------- | -------------- | :------------: | ------------------------------------------------------- | | srcDir | File | src/main/slice | The Slice file source directory. | | args | String | - | The arguments to `slice2freezej`. | | files | FileCollection | - | The Slice files in this source set. Overrides `srcDir`. | | include | Set | - | Slice include file search path. | Refer to the [slice2freezej Command-Line Options][5] for a description of the options you can provide through the `args` property. Note: the `slice` directory of your Ice installation (`${slice.iceHome}/slice`) is automatically added to `include` by the plug-in. #### `dict` Block A `dict` block describes one ore more Freeze maps (also known as dictionaries) generated by `slice2freezej`. Each map in such a block must have a unique name. ```gradle slice { freezej { dict { Dict1 { ... } Dict2 { ... } } } } ``` ##### `dict` Properties `dict` defines the following convention properties: | Property name | Type | Default value | Description | | ------------- | -------------- | :-----------: | ------------------------------------------ | | javaType | String | - | The name of the generated Java type. | | key | String | - | The Slice type of the key. | | value | String | - | The Slice type of the value. | | index | List\> | - | Secondary index or indices. | The `index` is a list of maps. Valid entries in each map are as follows: | Key (String) | Value Type | Default value | Description | | ------------- | ------------- | :-----------: | ------------------------------------------------------------------------------- | | member | String | - | The name of a data member in the Freeze map value type. | | caseSensitive | boolean | true | If member is a string, this specifies whether the comparison is case sensitive. | ##### dict Examples Given the following Slice definitions in `Test.ice`: ``` // Slice module Test { struct Foo { string s; Struct1 s1; } } ``` Generate a Freeze map named `StringFooMap` that maps a `string` to the Slice type `Test::Foo`: ```gradle slice { freezej { files = [file("Test.ice")] dict { StringFooMap { javaType = "Test.StringFooMap" key = "string" value = "Test::Foo" } } } } ``` Generate the same Freeze map, but this time with an index on the data member `s` of the `Foo` structure: ```gradle slice { freezej { files = [file("Test.ice")] dict { StringFooMap { javaType = "Test.StringFooMap" key = "string" value = "Test::Foo" index = [["member" : "s"]] // Example: case insensitive // index = [["member" : "s", "caseSensitive": false]] // Example: two indices. // index = [["member" : "s"], ['member': 's1']] } } } } ``` Generate an `int` to `string` map, and create an index on the `string` value: ```gradle slice { freezej { dict { IntToStringMap { javaType = "Test.IntToStringMap" key = "int" value = "string" index = [[]] // list with one empty map to create an index on the full value // Same index but case insensitive: // index = [["caseSensitive": false]] } } } } ``` #### `index` Block An `index` block describes one ore more Freeze Evictor indices generated by `slice2freezej`. Each index must have a unique name. ```gradle slice { freezej { index { Index1 { ... } Index2 { ... } } } } ``` ##### `index` Properties `index` defines the following convention properties: | Property name | Type | Default value | Description | | ------------- | ------- | :-----------: | ----------------------------------------------------------------------------------- | | javaType | String | - | The name of the generated Java type. | | type | String | - | The Slice type of the type to be indexed. | | member | String | - | The name of the data member in the type to index. | | caseSensitive | boolean | true | If the member is a string, this specifies whether the comparison is case sensitive. | ##### index Example Given the following Slice type defined in `Phonebook.ice`: ``` // Slice module Demo { class Contact { string name; string address; string phone; } } ``` Generate a Freeze Evictor index `NameIndex` for the data member `name`: ```gradle freezej { files = [file("PhoneBook.ice")] index { NameIndex { javaType = "NameIndex" type = "Demo::Contact" member = "name" caseSensitive = false } } } ``` ## When does the Plug-in Recompile Slice Files? Slice files will be recompiled if either of the following are true: * This Slice file or a Slice file included directly or indirectly by this Slice file was updated after the last compilation of the Slice file through the plug-in. * The options used to compile this Slice file have changed. Removing a Slice file from a source set will trigger the removal of the corresponding generated `.java` files the next time the source set is built. [1]: https://doc.zeroc.com/display/Ice/The+Slice+Language [2]: https://doc.zeroc.com/display/Ice/slice2java+Command-Line+Options [3]: https://doc.zeroc.com/display/Freeze37/Using+a+Map+in+Java [4]: https://github.com/zeroc-ice/ice [5]: https://doc.zeroc.com/display/Freeze37/slice2freezej+Command-Line+Options ice-builder-gradle-1.4.5/CONTRIBUTING.md0000664000175000017500000000467313233633150016067 0ustar josejose# Contributing to the Ice Builder for Gradle Thank you for your interest in contributing to the Ice Builder for Gradle! ## How to Contribute Follow these steps to contribute code or documentation to this project: 1. Download and review carefully our [Contributor Agreement](https://zeroc.com/download/ZeroCContributorAgreement.pdf), and send us a completed and signed copy. Please sign this agreement with a pen, as we do not accept electronic signatures.
Then email a scanned copy of this agreement to contributing@zeroc.com, or send us an original paper copy by [snail mail](https://zeroc.com/about.html#contact). You need to do this only once, before your first contribution. 2. For large contributions (see below), make sure to first discuss your ideas with the [community](https://forums.zeroc.com) or by sending us an email. 3. Fork this repository. 4. Follow this project's naming and coding conventions when implementing your contribution - we want to keep all our source code consistent. 5. Update the test suite if appropriate for your contribution. 6. Submit a pull request. We review carefully any contribution that we accept, and these reviews may take some time. Please keep in mind there is no guarantee your contribution will be accepted: we may reject a pull request for any reason, or no reason. ## Our Favorite Contributions We prefer small contributions as they are easier to review and integrate. If you want to contribute but don't know where to start, consider one of these areas: * New sample programs (in the [ice-demos](https://github.com/zeroc-ice/ice-demos) repository) * Small bug fixes that affect only one or a few source files * Fixes for the documentation * Ports to new platforms and compilers ## Large Contributions Please don't spend weeks or months on a new feature without checking with us first! Some contributions are troublesome and therefore difficult to accept: * New features that require a new version of the Ice encoding or Ice protocol
For example, adding a new Slice type would most likely require a new version of the Ice encoding * New features that may be useful for your project but are not obviously useful to other projects
We want to keep our software lean and focused! * Any update that breaks source compatibility with the most recent release ## Contact * Community Forums: https://forums.zeroc.com * Twitter: https://twitter.com/zeroc * Email: contributing@zeroc.com ice-builder-gradle-1.4.5/LICENSE0000664000175000017500000000270213233633150014632 0ustar josejoseCopyright (c) 2014-2015, ZeroC, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name ZeroC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY ZEROC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZEROC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ice-builder-gradle-1.4.5/build.gradle0000664000175000017500000001111413233633150016101 0ustar josejose// ********************************************************************** // // Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved. // // ********************************************************************** buildscript { if(!localOnly.toBoolean()) { repositories { maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath "com.gradle.publish:plugin-publish-plugin:0.9.9" } } } if(!localOnly.toBoolean()) { apply plugin: "com.gradle.plugin-publish" } apply plugin: 'groovy' apply plugin: 'maven' sourceCompatibility = 1.7 targetCompatibility = 1.7 if(!localOnly.toBoolean()) { repositories { mavenCentral() } } dependencies { compile gradleApi() compile localGroovy() if(!localOnly.toBoolean()) { testCompile 'junit:junit:4.12' testCompile 'com.github.stefanbirkner:system-rules:1.16.0' } } test { testLogging { events = ["failed", "skipped"] exceptionFormat = "full" showStandardStreams = false } onlyIf { ! localOnly.toBoolean() } } sourceSets { main { groovy { srcDir "src/main/groovy" } resources { srcDir "src/main/resources" } } } version = "1.4.5" group = "com.zeroc.gradle.ice-builder" if(!localOnly.toBoolean()) { pluginBundle { website = 'https://github.com/zeroc-ice/ice-builder-gradle' vcsUrl = 'https://github.com/zeroc-ice/ice-builder-gradle.git' description = 'Plugin to automate the compilation of Slice files to Java' tags = ['zeroc', 'ice', 'slice'] plugins { slicePlugin { id = 'com.zeroc.gradle.ice-builder.slice' displayName = 'Ice Builder for Gradle' } } } // // Used to build the gradle wrapper to automatically download and install // the version of gradle needed to build plugin. // task wrapper(type: Wrapper) { gradleVersion = "4.4" } } else { prefix = prefix ? prefix : (System.properties['os.name'].toLowerCase().contains('windows') ? "C:\\ice-builder-gradle-${project.version}" : "/opt/ice-builder-gradle-${project.version}") def jarDir = (prefix == "/usr" || prefix == "/usr/local") ? "${prefix}/share/java" : "${prefix}/lib" def pomName = "$buildDir/libs/${project.name}-${project.version}.pom" def pomLicense = project.hasProperty("licenseURL") ? licenseURL : "https://github.com/zeroc-ice/ice-builder-gradle/blob/master/LICENSE" task writeNewPom << { pom { project { name 'Ice Builder for Gradle' description 'Plugin to automate the compilation of Slice files to Java' url 'https://zeroc.com' scm { connection 'scm:git:git@github.com/zeroc-ice/ice-builder-gradle.git' developerConnection 'scm:git:git@github.com/zeroc-ice/ice-builder-gradle.git' url 'git://github.com/zeroc-ice/ice-builder-gradle.git' } licenses { license { name 'The BSD 3-Clause License' url pomLicense distribution 'repo' } } organization { name 'ZeroC, Inc.' url 'https://zeroc.com' } developers { developer { name = 'ZeroC Developers' email = 'info@zeroc.com' organization = 'ZeroC, Inc.' organizationUrl = 'https://zeroc.com' } } } }.writeTo(pomName) } jar.dependsOn(writeNewPom) task groovydocJar(type: Jar, dependsOn: groovydoc) { classifier = 'groovydoc' from groovydoc destinationDir = new File("$buildDir/libs") } assemble.dependsOn(groovydocJar) task sourcesJar(type: Jar, dependsOn: jar) { classifier = 'sources' from sourceSets.main.allSource destinationDir = new File("$buildDir/libs") } assemble.dependsOn(sourcesJar) task install(type: Copy, dependsOn: assemble, overwrite: true) { from "${pomName}" from "$buildDir/libs/${jar.archiveName}" from "$buildDir/libs/${project.name}-${project.version}-sources.jar" from "$buildDir/libs/${project.name}-${project.version}-groovydoc.jar" into "${DESTDIR}${jarDir}" } } ice-builder-gradle-1.4.5/.gitattributes0000664000175000017500000000004613233633150016517 0ustar josejose* text=auto gradlew.bat text eol=crlf ice-builder-gradle-1.4.5/.gitignore0000664000175000017500000000004413233633150015612 0ustar josejosebuild .gradle .DS_Store .idea *.iml