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

enhanced Build Script

parent 40012594
No related branches found
No related tags found
No related merge requests found
apply plugin: 'base' apply plugin: 'base'
/* --! Please Define the Parent ID and and the Group Id! --! */
groupID = "de.prob"
parentID = "de.prob.parent"
//--- Defining Tycho POM parts --// //--- Defining Tycho POM parts --//
def artifact(artifactId,versionNumber) { """ def artifact(artifactId,versionNumber) { """
<groupId>de.prob</groupId> <groupId>${groupId()}</groupId>
<artifactId>${artifactId}</artifactId> <artifactId>${artifactId}</artifactId>
<version>${versionNumber}</version> <version>${versionNumber}</version>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>
...@@ -21,10 +28,10 @@ apply plugin: 'base' ...@@ -21,10 +28,10 @@ apply plugin: 'base'
def elder() {""" def elder() {"""
<parent> <parent>
<groupId>de.prob</groupId> <groupId>${groupId()}</groupId>
<artifactId>de.prob.parent</artifactId> <artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version> <version>1.0.0.qualifier</version>
<relativePath>../de.prob.parent/pom.xml</relativePath> <relativePath>../${parentId()}/pom.xml</relativePath>
</parent> </parent>
"""} """}
...@@ -63,10 +70,14 @@ def download(address,target) { ...@@ -63,10 +70,14 @@ def download(address,target) {
def projects(int i){ def projects(int i){
return subprojects.name[i] return subprojects.name[i]
} }
// returns the name of a subproject listed in the settings.gradle file
def numberOfProjects(){ def numberOfProjects(){
return subprojects.name.size() return subprojects.name.size()
} }
// returns the number of projects listed in the settings.gradle file
task downloadCli << { task downloadCli << {
dir = 'de.prob.core/prob/' dir = 'de.prob.core/prob/'
...@@ -90,9 +101,29 @@ task downloadCli << { ...@@ -90,9 +101,29 @@ task downloadCli << {
} }
/* -- Define ParentId -- */
def 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 { subprojects {
apply plugin: 'base' apply plugin: 'base'
......
...@@ -3,7 +3,7 @@ ...@@ -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"> <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> <modelVersion>4.0.0</modelVersion>
<groupId>de.prob</groupId> <groupId>${groupId()}</groupId>
<artifactId>${artifactId}</artifactId> <artifactId>${artifactId}</artifactId>
<version>1.0.0.qualifier</version> <version>1.0.0.qualifier</version>
...@@ -65,7 +65,7 @@ def endParent() {""" ...@@ -65,7 +65,7 @@ def endParent() {"""
deploy <<{ deploy <<{
versionNumber = '1.0.0.qualifier' versionNumber = '1.0.0.qualifier'
artifactId = 'de.prob.parent' artifactId = parentId()
println projects(2) + numberOfProjects() + projects(1) println projects(2) + numberOfProjects() + projects(1)
...@@ -85,7 +85,7 @@ deploy <<{ ...@@ -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() { """ def parentPom() { """
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
......
def reposi() { """ def reposi(artifact) { """
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project <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"> 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> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>de.prob</groupId> <groupId>${groupId()}</groupId>
<artifactId>de.prob.parent</artifactId> <artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version> <version>1.0.0.qualifier</version>
<relativePath>../de.prob.parent/pom.xml</relativePath> <relativePath>../${parentId()}/pom.xml</relativePath>
</parent> </parent>
<groupId>de.prob</groupId> <groupId>${groupId()}</groupId>
<artifactId>de.prob.repository</artifactId> <artifactId>${artifact}</artifactId>
<version>1.0.0.qualifier</version> <version>1.0.0.qualifier</version>
<packaging>eclipse-repository</packaging> <packaging>eclipse-repository</packaging>
</project> </project>
...@@ -27,6 +27,6 @@ deploy <<{ ...@@ -27,6 +27,6 @@ deploy <<{
def f = new File(artifactId+'/pom.xml') def f = new File(artifactId+'/pom.xml')
f.delete() f.delete()
f << reposi() f << reposi(artifactId)
} }
\ No newline at end of file
...@@ -4,12 +4,12 @@ def feature(artifactId, versionNumber) { """ ...@@ -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"> 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> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>de.prob</groupId> <groupId>${groupId()}</groupId>
<artifactId>de.prob.parent</artifactId> <artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version> <version>1.0.0.qualifier</version>
<relativePath>../de.prob.parent/pom.xml</relativePath> <relativePath>../${parentId()}/pom.xml</relativePath>
</parent> </parent>
<groupId>de.prob</groupId> <groupId>${groupId()}</groupId>
<artifactId>${artifactId}</artifactId> <artifactId>${artifactId}</artifactId>
<version>${versionNumber}</version> <version>${versionNumber}</version>
<packaging>eclipse-feature</packaging> <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