Hi all !
I’m working on gradle project which will help me to produce setup (with innosetup).
The script download the dependencies from an JFrog’s artifactory server and compile all dependencies to build a setup.
This gradle script is used into Jenkins and the generated setup is send to artifactory, into a generic repository.
How can i define the produced setup as an artifact into my gradle script ?
(in order to send it by jenkins into artifactory with the pattern : [org]/[module]/baseRev/[module]-baseRev(-[classifier]).[ext])
build.grade:
// in order to use Inno Setup
apply plugin: 'distribution’
apply plugin: “com.jfrog.artifactory”
// Definition of the current project
version = '3.2.0’
description = ‘Setup builder module’
// package definition object
configurations { setupCfg }
// defininition of the repository used
repositories {
maven {
url "http://172.20.81.79:8081/artifactory/"
credentials {
username = "${artifactory_user}"
password = “${artifactory_password}”
}
}
}
// definition of the content of the setup recovered from the repositories
dependencies {
// core applicationDistribution
setupCfg(group: ‘app-artifacts.sp-tools’, name: ‘myapp’, version: project.version, ext: ‘exe’)
// common libs
setupCfg(group: 'app-libs.ms-runtime', name: 'MSVCP71', version: '7.10.3077.0', ext: 'DLL')
}
// Main task to build the setup
task buildsetup(dependsOn :[“installDist”]) << {
println "Package Initsrvpdt dependencies found : "
// manage build directory
def innoSetupDir = new File("${buildDir}/innosetup")
def innoSetupDirArtifacts = new File("${innoSetupDir}/artifacts")
delete fileTree(dir: innoSetupDir)
innoSetupDir.mkdir();
// Copying resolved artifacts
configurations.setupCfg.resolvedConfiguration.resolvedArtifacts.each { artifact ->
project.copy {
from artifact.file
into innoSetupDirArtifacts
rename { "${artifact.name}.${artifact.extension}" }
}
}
// Copying Inno setup source file
copy {
from("${rootProject.projectDir}/gradle/innosetup/setup.iss.skel")
rename("setup.iss.skel", "setup.iss")
into(innoSetupDir)
}
println "${innoSetupDir}\\setup.iss"
//launch the build of setup
exec {
workingDir rootProject.projectDir
commandLine "ISCC ${innoSetupDir}/setup.iss".split()
}
copy {
from("${innoSetupDir}//Installation/Setup.exe")
into(rootDir)
}
delete fileTree(dir: innoSetupDir)
}