diff --git a/build.gradle b/build.gradle index 8618cc881345810b157da09f30dcb30927ce9d9f..43dbf8ebcf4537f093301531dd5d12cc429eb676 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,17 @@ 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' diff --git a/de.prob.parent/build.gradle b/de.prob.parent/build.gradle index 20ea06862197d3582747df7f7bb41c58ae3b74eb..6b332ad775f04d00eb1e471ca01074fac53f3008 100644 --- a/de.prob.parent/build.gradle +++ b/de.prob.parent/build.gradle @@ -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"?> diff --git a/de.prob.repository/build.gradle b/de.prob.repository/build.gradle index 7ae8245ec2d6819d28c964cbeaec020d3b5eaac1..ab746c32baa9980cd848c6d9f488d168ebff59af 100644 --- a/de.prob.repository/build.gradle +++ b/de.prob.repository/build.gradle @@ -1,18 +1,18 @@ -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 diff --git a/de.prob2.feature/build.gradle b/de.prob2.feature/build.gradle index 327bb749580a26351d54402095dd1eb5c78479ef..695a03f7a501233685eb4231dd11eeb548deb29f 100644 --- a/de.prob2.feature/build.gradle +++ b/de.prob2.feature/build.gradle @@ -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>