Hello Szczepan!
Thank you for your reply! I didn't manage to explain my intentions properly.
What I want to get (and mostly got by now) is the following:
1. Maven Repository (with normal Maven file names and versions) that is
proxy for Central repository and also hosts all our company projects
artifacts.
2. Gradle build process which produces:
a) Artifacts to upload to Maven (optionally)
b) Zip files which includes:
1) jars named as 'A-1.0.0-SNAPSHOT_rNNNN_vTIMESTAMP.jar'
2) jars of external 3rd party depenendices names as 'LIB-1.2.3.jar'
3) jars of our company projects (got from Maven) named as
'B-1.0.0-SNAPSHOT_rNNNN_vTIMESTAMP.jar'
Above build processes run on CI server and has 'snapshot' dependencies for
our internal projects (and need to check for new artifacts on each build).
Ant it looks that I managed to implement all that. I wrote a Gradle plugin
that do the following:
For build.gradle like:
group = 'org.company.sandbox'
version = '1.0.0-SNAPSHOT'
apply plugin: 'java'
// custom plugin
apply plugin: 'build'
dependencies {
compile 'org.company.sandbox:A:1.0.0-SNAPSHOT'
}
jar << {
copy {
from configurations.compile.files
from jar.archivePath
into 'build/dependencies'
eachFile project.dependencyVersionExpander
}
}
task composeZip(type: zip, dependsOn: jar) {
from configurations.compile.files
from jar.archivePath
}
// add artifacts that have to be uploaded to maven to the 'maven'
// configuration (optional).
artifacts {
maven jar
}
The following is done:
1. project.version is changed to project.version + timestamp, so that
generated jars get "long" version.
2. Default mavenrepo and mavenDeployer added (unless specified), maven
configuration is added. I have to use custom resolver class because of
http://issues.gradle.org/browse/GRADLE-1485
3. mavenDeployer.pom.version is set to "short" version
4. all jar/war tasks injected with additional manifest attribute, so that
every jar manifest includes 'Build-Version' and 'Build-Number' properties
5. all copy tasks injected with 'eachFile
project.dependencyVersionExpander' which renames jars copied from local ivy
cache so that they get "long" version (when it is available, and it is
available for our company jars)
6. I didn't find a way to inject 'eachFile' closure to all copy actions, so
as in example above one should explicitly specify it. But it is injected
automatically into the zip task.
As a result I get artifacts uploaded to Maven (with normal Maven version
name) and build process of another project have the same artifacts available
with proper "long" names.
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Artifacts-repositories-and-version-numbers-tp4309829p4313373.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email