Skip to content
Snippets Groups Projects
Commit 2ce87c69 authored by Jens Bendisposto's avatar Jens Bendisposto
Browse files

autobuild

parent 8c984b24
No related branches found
No related tags found
No related merge requests found
apply plugin: 'base'
//--- Defining Tycho POM parts --//
def artifact(artifactId,versionNumber) { """
<groupId>de.prob</groupId>
<artifactId>${artifactId}</artifactId>
<version>${versionNumber}</version>
<packaging>eclipse-plugin</packaging>
""" }
def start() { """<?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>
"""}
def elder() {"""
<parent>
<groupId>de.prob</groupId>
<artifactId>de.prob.parent</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../de.prob.parent/pom.xml</relativePath>
</parent>
"""}
def repos() {"""
<repositories>
<!-- configure p2 repository to resolve against -->
<repository>
<id>prob_target</id>
<layout>p2</layout>
<url>http://cobra.cs.uni-duesseldorf.de/prob_dev_target/</url>
</repository>
<repository>
<id>indigo</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/indigo/</url>
</repository>
</repositories>
"""}
def end() {"""
</project>
"""}
subprojects {
apply plugin: 'base'
task deploy(){
description = "\tGenerating the Tycho Poms"
versionNumber = 'Version Number Error: check Manifest for Bundle-Version Number'
/* -- In case of changed Manifest File in Eclipse:
*
* Version Numbers of the projects are collected via
* regular expressions in the Manifest.MF File.
* Versionnumber of the projects are equal to their
* Bundle-Version Number
*/
}
}
task deploy(dependsOn: subprojects.deploy)
task install(dependsOn: deploy , type:Exec) {
description = "\tExecutes a 'mvn install' of the parent pom.xml and auto-generates Tycho Poms"
commandLine 'mvn', 'install', '-f', 'de.prob.parent/pom.xml'
}
// Build Script can be executed via gradle install
// Pom Generation can be executed via gradle deploy
deploy <<{
content = new File("de.bmotionstudio.gef.editor/META-INF/MANIFEST.MF").getText("UTF-8")
printFileLine = { if( it ==~ /Bundle-Version.+qualifier/ ){
versionNumber = it.substring(16) // possibile error: cuts off first 16 chars
/* Version Number is taken from Bundle-Version in Manifest.MF
* If there is no Bundle-Version or the versionnumber needs to
* be taken from a different key word, please change the
* regular expression and the substring above
*/
}
}
content.eachLine( printFileLine )
artifactId = 'de.bmotionstudio.gef.editor'
println artifactId
println "\t"+versionNumber
def f = new File(artifactId+'/pom.xml')
f.delete()
f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end()
}
\ No newline at end of file
deploy <<{
content = new File("de.bmotionstudio.rodin/META-INF/MANIFEST.MF").getText("UTF-8")
printFileLine = { if( it ==~ /Bundle-Version.+qualifier/ ){
versionNumber = it.substring(16) // possibile error: cuts off first 16 chars
/* Version Number is taken from Bundle-Version in Manifest.MF
* If there is no Bundle-Version or the versionnumber needs to
* be taken from a different key word, please change the
* regular expression and the substring above
*/
}
}
content.eachLine( printFileLine )
artifactId = 'de.bmotionstudio.rodin'
println artifactId
println "\t"+versionNumber
def f = new File(artifactId+'/pom.xml')
f.delete()
f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end()
}
\ No newline at end of file
apply plugin: 'base'
deploy <<{
content = new File("de.prob.core/META-INF/MANIFEST.MF").getText("UTF-8")
printFileLine = { if( it ==~ /Bundle-Version.+qualifier/ ){
versionNumber = it.substring(16) // possibile error: cuts off first 16 chars
/* Version Number is taken from Bundle-Version in Manifest.MF
* If there is no Bundle-Version or the versionnumber needs to
* be taken from a different key word, please change the
* regular expression and the substring above
*/
}
}
content.eachLine( printFileLine )
artifactId = 'de.prob.core'
println artifactId
println "\t"+versionNumber
def f = new File(artifactId+'/pom.xml')
f.delete()
f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end()
/*
* old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files
*/
}
def parentPom() { """
<?xml version="1.0" encoding="UTF-8"?>
<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>
<artifactId>de.prob.parent</artifactId>
<version>1.0.0.qualifier</version>
<packaging>pom</packaging>
<!-- this is the parent POM from which all modules inherit common settings -->
<properties>
<tycho-version>0.14.1</tycho-version>
</properties>
<repositories>
<!-- configure p2 repository to resolve against -->
<repository>
<id>prob_target</id>
<layout>p2</layout>
<url>http://cobra.cs.uni-duesseldorf.de/prob_dev_target/</url>
</repository>
<repository>
<id>indigo</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/indigo/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<!-- enable tycho build extension -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.14.1</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<!-- the modules that should be built together -->
<modules>
<module>../de.prob.core</module>
<module>../de.bmotionstudio.gef.editor</module>
<module>../de.bmotionstudio.rodin</module>
<module>../de.prob.ui</module>
<module>../de.prob.plugin</module>
<!-- <module>../de.prob.feature</module> -->
<module>../de.prob2.feature</module>
<module>../de.prob.repository</module>
</modules>
</project>
"""}
deploy <<{
versionNumber = '1.0.0.qualifier'
artifactId = 'de.prob.parent'
def f = new File(artifactId+'/pom.xml')
f.delete()
f << parentPom()
}
\ No newline at end of file
deploy <<{
content = new File("de.prob.plugin/META-INF/MANIFEST.MF").getText("UTF-8")
printFileLine = { if( it ==~ /Bundle-Version.+qualifier/ ){
versionNumber = it.substring(16) // possibile error: cuts off first 16 chars
/* Version Number is taken from Bundle-Version in Manifest.MF
* If there is no Bundle-Version or the versionnumber needs to
* be taken from a different key word, please change the
* regular expression and the substring above
*/
}
}
content.eachLine( printFileLine )
artifactId = 'de.prob.plugin'
println artifactId
println "\t"+versionNumber
def f = new File(artifactId+'/pom.xml')
f.delete()
f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end()
}
\ No newline at end of file
def reposi() { """
<?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>
<version>1.0.0.qualifier</version>
<relativePath>../de.prob.parent/pom.xml</relativePath>
</parent>
<groupId>de.prob</groupId>
<artifactId>de.prob.repository</artifactId>
<version>1.0.0.qualifier</version>
<packaging>eclipse-repository</packaging>
</project>
"""}
deploy <<{
versionNumber = '1.0.0.qualifier'
artifactId = 'de.prob.repository'
println artifactId
def f = new File(artifactId+'/pom.xml')
f.delete()
f << reposi()
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/de.prob.feature_1.0.0.qualifier.jar" id="de.prob.feature" version="1.0.0.qualifier">
<category name="de.prob.category"/>
</feature>
<feature url="features/de.prob2.feature_2.3.0.qualifier.jar" id="de.prob2.feature" version="2.3.0.qualifier">
<category name="de.prob2.category"/>
</feature>
<category-def name="de.prob.category" label="Prob Category">
<description>
ProB is an animator and model checker for the B-Method. It allows
fully automatic animation of many B specifications, and can be
used to systematically check a specification for errors.
Part of the research and development was conducted within the
EPSRC funded projects ABCD and iMoc, and within the EU funded
project Rodin.
Development is continued under the EU funded project Deploy and
the DFG project Gepavas.
ProB has been successfully used on various industrial specifications
and is now being used within Siemens.
</description>
</category-def>
<category-def name="de.prob2.category" label="ProB Rodin Plugin">
<description>
ProB is an animator and model checker for the B-Method. It allows
fully automatic animation of many B specifications, and can be
used to systematically check a specification for errors.
Part of the research and development was conducted within the
EPSRC funded projects ABCD and iMoc, and within the EU funded
project Rodin.
Development is continued under the EU funded project Deploy and
the DFG project Gepavas.
ProB has been successfully used on various industrial specifications
and is now being used within Siemens.
</description>
</category-def>
</site>
deploy <<{
content = new File("de.prob.ui/META-INF/MANIFEST.MF").getText("UTF-8")
printFileLine = { if( it ==~ /Bundle-Version.+qualifier/ ){
versionNumber = it.substring(16) // possibile error: cuts off first 16 chars
/* Version Number is taken from Bundle-Version in Manifest.MF
* If there is no Bundle-Version or the versionnumber needs to
* be taken from a different key word, please change the
* regular expression and the substring above
*/
}
}
content.eachLine( printFileLine )
artifactId = 'de.prob.ui'
println artifactId
println "\t"+versionNumber
def f = new File(artifactId+'/pom.xml')
f.delete()
f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end()
}
\ No newline at end of file
include 'de.prob.parent', 'de.prob.core', 'de.bmotionstudio.gef.editor' ,'de.bmotionstudio.rodin', 'de.prob.feature', 'de.prob.plugin', 'de.prob.repository', 'de.prob.ui', 'de.prob2.feature'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment