Skip to content
Snippets Groups Projects
Commit 2bf012c7 authored by birkhoff's avatar birkhoff
Browse files

enhanced Build Script

parent 40012594
Branches
Tags
No related merge requests found
apply plugin: 'base'
/* --! Please Define the Parent ID and and the Group Id! --! */
groupID = "de.prob"
parentID = "de.prob.parent"
//--- Defining Tycho POM parts --//
def artifact(artifactId,versionNumber) { """
<groupId>de.prob</groupId>
<groupId>${groupId()}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${versionNumber}</version>
<packaging>eclipse-plugin</packaging>
......@@ -21,10 +28,10 @@ apply plugin: 'base'
def elder() {"""
<parent>
<groupId>de.prob</groupId>
<artifactId>de.prob.parent</artifactId>
<groupId>${groupId()}</groupId>
<artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../de.prob.parent/pom.xml</relativePath>
<relativePath>../${parentId()}/pom.xml</relativePath>
</parent>
"""}
......@@ -63,10 +70,14 @@ def download(address,target) {
def projects(int i){
return subprojects.name[i]
}
// returns the name of a subproject listed in the settings.gradle file
def numberOfProjects(){
return subprojects.name.size()
}
// returns the number of projects listed in the settings.gradle file
task downloadCli << {
dir = 'de.prob.core/prob/'
......@@ -90,9 +101,29 @@ task downloadCli << {
}
/* -- Define ParentId -- */
def parentId(){
return "de.prob.parent"
return parentID
}
/*
* This is the project of the parent Pom
* The Tycho Maven Build is triggered from
* this project's pom
*/
/* -- Define Group Id -- */
def groupId(){
return groupID
}
/*
* This Group ID will be used in every sub project
*/
subprojects {
apply plugin: 'base'
......
......@@ -3,7 +3,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.prob</groupId>
<groupId>${groupId()}</groupId>
<artifactId>${artifactId}</artifactId>
<version>1.0.0.qualifier</version>
......@@ -65,7 +65,7 @@ def endParent() {"""
deploy <<{
versionNumber = '1.0.0.qualifier'
artifactId = 'de.prob.parent'
artifactId = parentId()
println projects(2) + numberOfProjects() + projects(1)
......@@ -85,7 +85,7 @@ deploy <<{
/*
!!!!! In case of problems the old parernt Pom Defenintion: !!!!
!!!!! In case of problems: This is the old parernt Pom Defenintion: !!!!
def parentPom() { """
<?xml version="1.0" encoding="UTF-8"?>
......
def reposi() { """
def reposi(artifact) { """
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.prob</groupId>
<artifactId>de.prob.parent</artifactId>
<groupId>${groupId()}</groupId>
<artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../de.prob.parent/pom.xml</relativePath>
<relativePath>../${parentId()}/pom.xml</relativePath>
</parent>
<groupId>de.prob</groupId>
<artifactId>de.prob.repository</artifactId>
<groupId>${groupId()}</groupId>
<artifactId>${artifact}</artifactId>
<version>1.0.0.qualifier</version>
<packaging>eclipse-repository</packaging>
</project>
......@@ -27,6 +27,6 @@ deploy <<{
def f = new File(artifactId+'/pom.xml')
f.delete()
f << reposi()
f << reposi(artifactId)
}
\ No newline at end of file
......@@ -4,12 +4,12 @@ def feature(artifactId, versionNumber) { """
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.prob</groupId>
<artifactId>de.prob.parent</artifactId>
<groupId>${groupId()}</groupId>
<artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../de.prob.parent/pom.xml</relativePath>
<relativePath>../${parentId()}/pom.xml</relativePath>
</parent>
<groupId>de.prob</groupId>
<groupId>${groupId()}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${versionNumber}</version>
<packaging>eclipse-feature</packaging>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment