/* * Copyright 2008-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ apply plugin: 'groovy' apply plugin: 'maven' sourceCompatibility = '1.5' targetCompatibility = '1.5' archivesBaseName = 'jidebuilder' configurations { deployerJars } repositories { flatDir(dirs: file('src/lib')) mavenCentral() mavenRepo urls: 'http://repository.sonatype.org/content/groups/public/' } dependencies { groovy "org.codehaus.groovy:groovy-all:$groovyVersion" compile "org.codehaus.groovy:groovy-all:$groovyVersion", 'com.jidesoft:jide-oss:2.9.1', 'com.kitfox.svg:svg-salamander:1.0' testCompile "junit:junit:4.8.2" deployerJars 'org.apache.maven.wagon:wagon-webdav:1.0-beta-2', 'org.apache.maven:maven-ant-tasks:2.1.0' } configure([compileGroovy, compileTestGroovy]) { groovyOptions.fork(memoryInitialSize: '128M', memoryMaximumSize: '1G') groovyOptions.encoding = "UTF-8" } configure([compileJava, compileTestJava]) { options.deprecation = true options.debug = true } metaInf << fileTree(dir: file('.'), includes: ['LICENSE.txt']) jar { manifest { attributes( 'Built-By': System.properties['user.name'], 'Created-By': System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")", 'Implementation-Version': version, 'Implementation-Vendor': 'griffon.codehaus.org', 'Implementation-Title': 'JideBuilder' ) } } task distSource(type: Copy) { destinationDir = "$buildDir/distributions/source" as File from(project.file('.')) { exclude 'build' exclude '**/.git*' exclude '.git*' exclude '.gradle*' exclude '**/*.ipr' exclude '**/*.iws' exclude '**/*.iml' } } task zipSource(type: Zip) { description = "Zips the source distribution." dependsOn { distSource } classifier = 'src' into "jidebuilder-$version" from "$buildDir/distributions/source" } task tarSource(type: Tar) { description = "Tars the source distribution." dependsOn { distSource } compression = Compression.GZIP classifier = 'src' into "jidebuilder-$version" from "$buildDir/distributions/source" } task fullDist(dependsOn: [jar, zipSource, tarSource]) { description = "Assembles all packages." } task wrapper(type: Wrapper) { gradleVersion = '0.9.2' jarFile = 'gradle/wrapper/gradle-wrapper.jar' } artifacts { archives jar } collectDependencies = { type -> configurations."${type}".allDependencies.grep(ExternalModuleDependency).collect([]) { dependency -> org.apache.maven.model.Dependency mavenDependency = new org.apache.maven.model.Dependency() mavenDependency.groupId = dependency.group mavenDependency.artifactId = dependency.name mavenDependency.version = dependency.version mavenDependency } } installer = install.repositories.mavenInstaller def deployer = null if(!project.hasProperty('codehausUsername')) codehausUsername = '' if(!project.hasProperty('codehausPassword')) codehausPassword = '' uploadArchives { repositories { deployer = mavenDeployer { name = 'codehausDeployer' configuration = configurations.deployerJars uploadDescriptor = true repository(url: codehausReleaseUrl) { authentication(userName: codehausUsername, password: codehausPassword) } snapshotRepository(url: codehausSnapshotUrl) { uniqueVersion = false authentication(userName: codehausUsername, password: codehausPassword) } } } } [installer, deployer].each { repo -> configure(repo) { pom.project { name 'JideBuilder' description 'JideBuilder: building UIs with Groovy/Jide JCL' url('http://griffon.codehaus.org/JideBuilder') licenses { license { name 'The Apache Software License, Version 2.0' url 'http://www.apache.org/licenses/LICENSE-2.0.txt' distribution 'repo' } }/* distributionManagement { repository { id('codehaus.org') name('Griffon Central Repository') url('dav:https://dav.codehaus.org/repository/griffon/') } snapshotRepository { uniqueVersion('false') id('codehaus.org') name('Griffon Central Development Repository') url('dav:https://dav.codehaus.org/snapshots.repository/griffon/') } }*/ repositories { repository { id('codehaus-release') name('Codehaus') url('http://repository.codehaus.org') } repository { id('sonatype-release') name('Sonatype') url('http://repository.sonatype.org/content/groups/public') } } } pom.whenConfigured { pom -> pom.dependencies = collectDependencies('compile') } } }