Il 02/08/2016 17:13, toogley ha
scritto:
now the patch is successful?Hey gil again, just that you don't missunderstand me: I've read your suggestions/mails, and I think i understand most of it. But i want to reproduce a working build based on the specfile. That means, i wanted to first understand how patches work with the specfile (or rather where my error with my small patch was). After that, i wanted to implement your suggestions/ideas in a clean way. That's why the small patch didn't contained the removal of the grooval versions - which I understand are useleless in fedora. regards, tobi/toogley On 08/02, toogley wrote:hey gil, On 07/31, gil wrote: i use this patch: ``` diff -Nru Gant-1.9.11/build.gradle Gant-1.9.11.build/build.gradle --- Gant-1.9.11/build.gradle 2014-05-05 17:07:24.000000000 +0200 +++ Gant-1.9.11.build/build.gradle 2016-07-29 19:32:59.127468016 +0200 @@ -56,47 +56,8 @@ final groovyArtefactName = 'groovy-all' ext.groovyVersions = [ - '2.0': '2.0.8', - '2.1': '2.1.9', - '2.2': '2.2.2', - '2.3': '2.3.0', ] -// One series of Groovy needs using for the standalone distribution. This version of Groovy will be packaged with -// the "standalone" distribution of Gant. It will generally be the latest widely available released version of Groovy. - -final groovyStandaloneSeries = '2.2' - -// Organize the build using subprojects. There is a subproject gant which is for the build using the -// locally installed Groovy and there is one for each version of Groovy obtained from the Maven repository -// that is supported. These functions ease doing the iteration over all the subprojects. NB Gradle -// requires the directories for each of the subprojects to exist. There is an assumption that each -// subproject has its own source, etc. This build slightly perverts the general approach by using exactly -// the same source for each subproject, the only difference is the version of Groovy used for compilation. - -def forEachDistributionVersion(Closure c) { - groovyVersions.keySet().each{String s -> c(artifact + mavenNameExtension + s) } -} - -def forEachProject(Closure c) { - c artifact - forEachDistributionVersion c -} - -forEachProject{item -> if (! new File(item).isDirectory()) { mkdir item }} - -ext.distributionTasks = [] -ext.debTasks = [] - -// Using the JackRabbit wagon gets round some problems associated with uploading the distributions that -// occurs with the standard wagon. However, it does not solve the problem of not creating missing -// directories that gives difficulties with new artefact uploads. Have to cadaver in and create the -// hierarchy first:-( Using the lightweight HTTP wagon still requires creating the directory structure -// with cadaver or equivalent:-( - -final webdavWagonName = 'org.apache.maven.wagon:wagon-webdav-jackrabbit:2.5' -//final webdavWagonName = 'org.apache.maven.wagon:wagon-http-lightweight:2.5' - // In creating distributions which include jar files for the source, javadoc, and groovydoc, it is // imperative to ensure that they do not get located into the library directory for jars containing // compiled code for execution: it is critical to avoid getting the source, javadoc, and groovydoc jars on @@ -133,7 +94,6 @@ test{groovy{srcDir '../src/test/groovy'}} integTest{groovy{srcDir '../src/integTest/groovy'}} } - metaInf << fileTree(dir: '..').matching{include 'LICENCE.txt'} final theVendor = 'The Codehaus' final theTitle = 'Gant: Scripting Ant tasks with Groovy.' jar{ @@ -158,8 +118,8 @@ } } repositories{ - if (project.hasProperty('gant_useMavenLocal') && gant_useMavenLocal) { mavenLocal() } - mavenCentral() + if (project.hasProperty('gant_useMavenLocal') && gant_useMavenLocal) { xmvn() } + xmvn() maven{url 'http://repository.codehaus.org/'} } dependencies{ @@ -169,7 +129,6 @@ ) testCompile 'junit:junit:4.11' testRuntime 'org.apache.ivy:ivy:2.3.0' - deployJars webdavWagonName } compileGroovy.options.compilerArgs = ['-Xlint'] [compileGroovy, compileTestGroovy]*.options*.encoding = 'UTF-8' @@ -194,7 +153,7 @@ final copyrightString = 'Copyright © 2006–2013 The Codehaus. All Rights Reserved.' javadoc{ options{ - overview 'overview.html' + overview '../overview.html' showAll() encoding 'UTF-8' setUse true @@ -210,7 +169,7 @@ javadoc.options.docTitle = javadoc.title } groovydoc{ - overview = 'overview.html' + overview = '../overview.html' includePrivate = false use = true windowTitle = packageTitle @@ -266,10 +225,6 @@ repositories{flatDir(name: 'groovyInstallation', dirs: [new File(groovyHome, 'embeddable'), groovyLib])} versionMessage = 'Using Groovy version ' + groovyVersion + ' from ' + groovyHome } - else { - groovyVersion = groovyVersions[groovyStandaloneSeries] - versionMessage = 'Using Groovy version ' + groovyVersion - } dependencies{compile(group: 'org.codehaus.groovy', name: groovyArtefactName, version: groovyVersion)} compileGroovy.doFirst{println('\n\t' + versionMessage +'\n')} final buildPath = [System.properties.'user.dir', 'gant', 'build', 'classes'] @@ -339,130 +294,21 @@ } } -forEachDistributionVersion{projectName-> - final groovyVersion = groovyVersions[projectName.replace(artifact + mavenNameExtension, '')] - project(projectName){ - apply plugin: 'maven' - dependencies{compile(group: 'org.codehaus.groovy', name: groovyArtefactName, version: groovyVersion)} - compileGroovy.doFirst{println('\n\tUsing Groovy version ' + groovyVersion + '\n')} - final buildPath = [System.properties.'user.dir', projectName, 'build', 'classes'] - final classPath = [] - classPath << (buildPath + ['main']).join(File.separator) - classPath << (buildPath + ['test']).join(File.separator) - configurations.testRuntime.files.each{file -> classPath << file.parent} - test.environment([ - GROOVY_ANT_TASK_TEST_VERSION: groovyVersion, - gradleClasspathString: classPath.join(System.properties.'path.separator') - ]) - install.repositories.mavenInstaller{pom pomSpecification} - gradle.taskGraph.whenReady{taskGraph -> - if (taskGraph.hasTask(uploadArchives)) { - if (! project.hasProperty('gant_experimentalMavenRepository') && !(project.hasProperty('codehausUsername') && project.hasProperty('codehausPassword'))) { - throw new RuntimeException('Must define both codehausUsername and codehausPassword to upload archives.') - } - if (! signingPropertiesAreSet()) { - throw new RuntimeException('Must define signing.keyId, signing.password, and signing.secretKeyRingFile') - } - uploadArchives.repositories.mavenDeployer{ - uniqueVersion = false - configuration = configurations.deployJars - beforeDeployment{MavenDeployment deployment -> signing.signPom(deployment)} - if (project.hasProperty('gant_experimentalMavenRepository')) { - if (! gant_experimentalMavenRepository) { throw new RuntimeException('gant_experimentalMavenRepository value not reasonable.') } - repository url: "file://${rootProject.buildDir}/${gant_experimentalMavenRepository}" - } - else { - //repository(url: 'dav:https://dav.codehaus.org/repository/gant/'){ - repository(url: 'https://dav.codehaus.org/repository/gant/'){ - authentication userName: codehausUsername, password: codehausPassword - } - //snapshotRepository(url: 'dav:https://dav.codehaus.org/snapshots.repository/gant/'){ - snapshotRepository(url: 'https://dav.codehaus.org/snapshots.repository/gant/'){ - authentication userName: codehausUsername, password: codehausPassword - } - } - pom pomSpecification - } - } - } - final binCopySpec = copySpec{ - final scriptsDirectory = '../scripts' - from('..'){include 'README*'} - into('conf'){from(scriptsDirectory + '/conf'){include '*.conf'}} - into('lib'){ - from libsDir - rename projectName + '-' + version, artifact + '-' + version + mavenNameExtension + '-' + groovyVersion - } - into('bin'){ - fileMode = 0755 - from([scriptsDirectory + '/bin', scriptsDirectory + '/bin_requiresGroovy']) - filter ReplaceTokens, tokens: [ - GROOVYPATH: 'embeddable', - GROOVYJAR: groovyArtefactName + '-' + groovyVersion + '.jar' - ] - } - } - task binTgz(type: Tar, dependsOn: 'jar', description: 'Build the distribution tarball.') { - baseName = artifact - classifier = mavenNameExtension + '-' + groovyVersion - compression = Compression.GZIP - into(gantPrefix){with binCopySpec} - } - task binZip(type: Zip, dependsOn: 'jar', description: 'Build the distribution zip file.') { - baseName = artifact - classifier = mavenNameExtension + '-' + groovyVersion - into(gantPrefix){with binCopySpec} - } - distributionTasks += [binTgz, binZip] - } - // Due to weird effective scoping of projects -- caused by cloning of bindings for projects? -- need to - // do the following to get the above tasks into the list defined by the main script. - distributionTasks += project(projectName).distributionTasks - ciBuildTasks << projectName + ':build' -} - -// ===================================================================== -// -// Create the standalone distribution. - -final projectNameForStandalone = 'gant_groovy' + groovyStandaloneSeries - -final standaloneCopySpec = copySpec{ - final scriptsDirectory = 'scripts' - final projectBase = project projectNameForStandalone - from('.'){include 'README*'} - into('conf'){from(scriptsDirectory + '/conf'){include '*.conf'}} - into('lib'){ - from projectBase.libsDir - from projectBase.configurations.runtime - } - into('bin'){ - fileMode = 0755 - from([scriptsDirectory + '/bin', scriptsDirectory + '/bin_standalone']) - filter ReplaceTokens, tokens: [ - GROOVYPATH: 'lib', - GROOVYJAR: groovyArtefactName + '-' + groovyVersions[groovyStandaloneSeries] + '.jar' - ] - } -} - -task standaloneBinTgz(type: Tar, dependsOn: projectNameForStandalone + ':jar', description: 'Create a tarball of the standalone distribution.') { +task standaloneBinTgz(type: Tar, dependsOn: ':jar', description: 'Create a tarball of the standalone distribution.') { baseName = artifact version = gantVersion compression = Compression.GZIP destinationDir = buildDir - into(gantPrefix){with standaloneCopySpec} + into(gantPrefix){} } -task standaloneBinZip(type: Zip, dependsOn: projectNameForStandalone + ':jar', description: 'Create a zip file of the standalone distribution.') { +task standaloneBinZip(type: Zip, dependsOn: ':jar', description: 'Create a zip file of the standalone distribution.') { baseName = artifact version = gantVersion destinationDir = buildDir - into(gantPrefix){with standaloneCopySpec} + into(gantPrefix){} } -distributionTasks += [standaloneBinTgz, standaloneBinZip] - // ===================================================================== // // Create the deb file of the standalone distribution. @@ -530,7 +376,6 @@ //} } -debTasks << standaloneDeb // ===================================================================== // @@ -551,8 +396,6 @@ into(gantPrefix + '/docs'){from project(':gant').docsDir} } -distributionTasks += [docTgz, docZip] - // ===================================================================== // // Create the source distribution. @@ -566,7 +409,7 @@ 'LICENCE.txt', 'README_Install.txt', 'releaseNotes.txt', - 'overview.html', + '../overview.html', ] task srcTgz(type: Tar, description: 'Create a tarball of the source.') { @@ -584,8 +427,6 @@ into(gantPrefix){from(projectDir){srcContent.each{include it}}} } -distributionTasks += [srcTgz, srcZip] - // ===================================================================== // // Tasks for getting all the distribution materials uploaded to Codehaus. @@ -604,8 +445,8 @@ else { configurations{upload} repositories{ - if (project.hasProperty('gant_useMavenLocal') && gant_useMavenLocal) { mavenLocal() } - mavenCentral() + if (project.hasProperty('gant_useMavenLocal') && gant_useMavenLocal) { xmvn() } + xmvn() } dependencies { upload 'com.googlecode.sardine:sardine:146' } assert uploadSpec.size() == 2 @@ -616,7 +457,7 @@ } } -task buildDistribution(dependsOn: distributionTasks, description: 'Build all the uploadable distribution archives.') +task buildDistribution task uploadDistribution(dependsOn: buildDistribution, description: 'Upload all the distribution archives.') << { checkAuthority() @@ -632,27 +473,13 @@ // // Tasks for getting all the debs uploaded to Codehaus. -task buildDebs(dependsOn: debTasks, description: 'Build all the uploadable debs.') - -task uploadDebs(dependsOn: buildDebs, description: 'Upload all the debs.') << { - checkAuthority() - undertakeUpload( - { - debTasks.each{task -> from task} - into rootProject.buildDir.absolutePath + '/' + gant_experimentalDistributionLocation + '/debs' - }, - ['debs', debTasks]) -} - // ===================================================================== // // Do a complete release. final archivesUploadTasks = [] -forEachDistributionVersion{archivesUploadTasks << ':' + it + ':uploadArchives'} -task uploadRelease(dependsOn: archivesUploadTasks + [uploadDistribution, uploadDebs], description: 'Upload all elements of a release.') // ===================================================================== // diff -Nru Gant-1.9.11/settings.gradle Gant-1.9.11.build/settings.gradle --- Gant-1.9.11/settings.gradle 2014-05-05 17:07:24.000000000 +0200 +++ Gant-1.9.11.build/settings.gradle 2016-08-02 17:30:25.880810257 +0200 @@ -14,4 +14,4 @@ // // Author: Russel Winder <russel@xxxxxxxxxxxxx> -include 'gant', 'gant_groovy2.0', 'gant_groovy2.1', 'gant_groovy2.2', 'gant_groovy2.3' +include 'gant' ``` regards .g |
-- java-devel mailing list java-devel@xxxxxxxxxxxxxxxxxxxxxxx https://lists.fedoraproject.org/admin/lists/java-devel@xxxxxxxxxxxxxxxxxxxxxxx