Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ProB Rodin Plugin
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
ProB Rodin Plugin
Commits
cfda90ca
Commit
cfda90ca
authored
13 years ago
by
Jens Bendisposto
Browse files
Options
Downloads
Patches
Plain Diff
changing the files a bit
parent
1ecd8570
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
build.gradle
+21
-457
21 additions, 457 deletions
build.gradle
build_setup.gradle
+0
-19
0 additions, 19 deletions
build_setup.gradle
local_tasks.gradle
+34
-0
34 additions, 0 deletions
local_tasks.gradle
tycho_build.gradle
+422
-0
422 additions, 0 deletions
tycho_build.gradle
with
477 additions
and
476 deletions
build.gradle
+
21
−
457
View file @
cfda90ca
apply
plugin:
'base'
apply
from:
'build_setup.gradle'
def
download
(
address
,
target
)
{
def
file
=
new
FileOutputStream
(
target
)
def
out
=
new
BufferedOutputStream
(
file
)
out
<<
new
URL
(
address
).
openStream
()
out
.
close
()
}
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/'
delete
file
(
dir
)
new
File
(
dir
).
mkdirs
()
[
'leopard'
:
'macos'
,
'linux'
:
'linux'
,
'linux64'
:
'linux64'
,
'win32'
:
'windows'
].
each
{
n
=
it
.
getKey
()
targetdir
=
dir
+
it
.
getValue
()
targetzip
=
dir
+
"probcli_${n}.zip"
url
=
"http://nightly.cobra.cs.uni-duesseldorf.de/cli/probcli_${n}.zip"
download
(
url
,
targetzip
)
FileTree
zip
=
zipTree
(
targetzip
)
copy
{
from
zip
into
targetdir
}
delete
file
(
targetzip
)
}
}
/* -- Return ParentId -- */
def
parentId
(){
return
parentID
}
/*
* This is the project of the parent Pom
* The Tycho Maven Build is triggered from
* this project's pom
*/
/* -- Return Group Id -- */
def
groupId
(){
return
groupID
}
/*
* This Group ID will be used in every sub project
*/
/////////////////////////////////////////////////////////////////////////////////////////
// -- !!! DEFINING SUB PROJECTS !!! -- //
/////////////////////////////////////////////////////////////////////////////////////////
subprojects
{
apply
plugin:
'base'
task
deleteArtifacts
(
type:
Delete
)
{
delete
'target'
,
'pom.xml'
}
task
deploy
()
<<{
description
=
"\tGenerating the Tycho Poms. Please remember to add a '.qualifier' to the version numbers!"
versionNumber
=
'Version Number Error:\tcheck Manifest for Bundle-Version Number and make sure to add a ".qualifier" to the version numbers!\n'
artifactId
=
'Could not find Bundle-SymbolicName in Manifest.file'
/* -- 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
*/
if
(
features
.
every
{
it
!=
project
.
name
}){
// Generating Poms for sub projects except features
content
=
new
File
(
"${project.name}/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
*/
}
if
(
it
==~
/Bundle-SymbolicName:.+/
){
artifactId
=
it
.
substring
(
21
)
artifactId
=
artifactId
.
replace
(
";singleton:=true"
,
''
)
}
/* Artifact ID is taken from Bundle-SymbolicName minus the
* 16 chars ';singleton:=true'
*/
}
content
.
eachLine
(
printFileLine
)
println
artifactId
println
"\t"
+
versionNumber
def
f
=
new
File
(
artifactId
+
'/pom.xml'
)
f
.
delete
()
f
<<
start
()+
elder
()+
artifact
(
artifactId
,
versionNumber
)+
end
()
/*
* old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files
*/
}
else
{
// if subprojects aren't a feature
// -- Features -- //
if
(
features
.
any
{
it
==
project
.
name
}
){
boolean
idfound
=
false
content
=
new
File
(
"${project.name}/feature.xml"
).
getText
(
"UTF-8"
)
printFileLine
=
{
if
(
it
==~
/.+version.+qualifier.+/
){
versionNumber
=
it
.
substring
(
15
,
it
.
size
()-
1
)
// possibile error: cuts off first 15 chars and leaves out last '"'
/* Version Number is taken from Feature.xml
* feature.xml is searched for version="version.qualifier"
* first 15 chars and last '"' are cut off
*/
}
if
(
it
==~
/.+id=".+/
&&
idfound
==
false
){
artifactId
=
it
.
substring
(
10
,
it
.
length
()-
1
)
idfound
=
true
}
/* Artifact ID is taken from Bundle-SymbolicName minus the
* 16 chars ';singleton:=true'
*/
}
content
.
eachLine
(
printFileLine
)
println
artifactId
println
"\t"
+
versionNumber
def
f
=
new
File
(
artifactId
+
'/pom.xml'
)
f
.
delete
()
f
<<
feature
(
artifactId
,
versionNumber
)
}
}
}
}
// defining subprojects
clean
{
dependsOn
+=
subprojects
.
deleteArtifacts
}
task
createParent
()
<<
{
// --------- define Parent --------- //
new
File
(
"${parentID}"
).
mkdir
()
versionNumber
=
'1.0.0.qualifier'
artifactId
=
parentId
()
def
f
=
new
File
(
artifactId
+
'/pom.xml'
)
f
.
delete
()
f
<<
parentPom
(
artifactId
)
for
(
int
i
=
0
;
i
<
targetRepositories
.
size
();
i
++){
f
<<
repos
(
targetRepositories
[
i
],
i
)
}
f
<<
endRepos
()
f
<<
moduleStart
()
for
(
int
i
=
0
;
i
<
numberOfProjects
();
i
++){
f
<<
module
(
projects
(
i
))
}
f
<<
module
(
repositoryName
)
f
<<
endParent
()
}
task
createRepository
()
<<
{
// ------------ define Repository --------- //
new
File
(
"${repositoryName}"
).
mkdir
()
versionNumber
=
'1.0.0.qualifier'
artifactId
=
repositoryName
featureVersionNumber
=
'1.0.0.qualifier'
def
f
=
new
File
(
artifactId
+
'/category.xml'
)
f
.
delete
()
f
<<
categoryHead
()
for
(
int
i
=
0
;
i
<
features
.
size
();
i
++){
content
=
new
File
(
"${features[i]}/feature.xml"
).
getText
(
"UTF-8"
)
printFileLine
=
{
if
(
it
==~
/.+version.+qualifier.+/
){
featureVersionNumber
=
it
.
substring
(
15
,
it
.
size
()-
1
)
// possibile error: cuts off first 15 chars and leaves out last '"'
/* Version Number is taken from Feature.xml
* feature.xml is searched for version="version.qualifier"
* first 15 chars and last '"' are cut off
*/
}
}
content
.
eachLine
(
printFileLine
)
f
<<
categoryFeatures
(
features
[
i
],
featureVersionNumber
)
}
// for
for
(
int
i
=
0
;
i
<
features
.
size
();
i
++){
f
<<
categoryDescription
(
features
[
i
],
descriptions
[
features
[
i
]][
0
]
,
descriptions
[
features
[
i
]][
1
])
// featureName, label, description
}
//for
f
<<
categoryEnd
()
def
pom
=
new
File
(
artifactId
+
'/pom.xml'
)
pom
.
delete
()
pom
<<
reposi
()
}
// end of repository definition
task
createPoms
(
dependsOn:
[
createParent
,
createRepository
,
subprojects
.
deploy
])
task
collectArtifacts
(
type:
Copy
)
{
from
'de.prob.repository/target/repository/'
into
'updatesite'
}
task
install
(
dependsOn:
[
createPoms
]
,
type:
Exec
)
{
description
=
"\tExecutes a 'mvn install' of the parent pom.xml and auto-generates Tycho Poms"
commandLine
'mvn'
,
'install'
,
'-f'
,
parentID
+
'/pom.xml'
}
//--- Defining Tycho POM parts --//
def
artifact
(
artifactId
,
versionNumber
)
{
"""
<groupId>${groupId()}</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>${groupId()}</groupId>
<artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../${parentId()}/pom.xml</relativePath>
</parent>
"""
}
def
end
()
{
"""
</project>
"""
}
// -- defining Parent Pom -- //
def
parentPom
(
artifactId
)
{
"""<?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>${groupId()}</groupId>
<artifactId>${artifactId}</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>indigo</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/indigo/</url>
</repository>
"""
}
def
repos
(
String
targetRepo
,
int
i
)
{
"""
<repository>
<id>targetRepository${i}</id>
<layout>p2</layout>
<url>${targetRepo}</url>
</repository>
"""
}
def
endRepos
()
{
"""
</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>
"""
}
def
moduleStart
(){
"""
<!-- the modules that should be built together -->
<modules>
"""
}
//for(int i = 0; i < numberOfProjects(); i++)
def
module
(
String
project
){
""" <module>../${project}</module>
"""
}
def
endParent
()
{
"""
</modules>
</project>
"""
}
// end of defining parent pom.xml
// repository Pom
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>${groupID}</groupId>
<artifactId>${parentID}</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../${parentID}/pom.xml</relativePath>
</parent>
<groupId>${groupID}</groupId>
<artifactId>${repositoryName}</artifactId>
<version>1.0.0.qualifier</version>
<packaging>eclipse-repository</packaging>
</project>
"""
}
// creates a category in
def
categoryHead
()
{
"""<?xml version="1.0" encoding="UTF-8"?>
<site>
"""
}
def
categoryFeatures
(
artifactId
,
versionNumber
){
"""
<feature url="features/${artifactId}_${versionNumber}.jar" id="${artifactId}" version="${versionNumber}">
<category name="${artifactId}.category"/>
</feature>
"""
}
def
categoryDescription
(
artifactId
,
categoryName
,
categorydescription
){
"""
<category-def name="${artifactId}.category" label="${categoryName}">
<description>
${categorydescription}
</description>
</category-def>
"""
}
def
categoryEnd
(){
"""
</site>
"""
}
// end of category definition
// feature pom
def
feature
(
artifactId
,
versionNumber
)
{
"""
<?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>${groupId()}</groupId>
<artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../${parentId()}/pom.xml</relativePath>
</parent>
<groupId>${groupId()}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${versionNumber}</version>
<packaging>eclipse-feature</packaging>
</project>
"""
}
// end of feature pom
// Build Script can be executed via gradle install
// Pom Generation can be executed via gradle deploy
groupID
=
"de.prob"
features
=
[
"de.prob2.feature"
]
// must be the same as the folder name
descriptions
=
[[
"de.prob2.feature"
:
"ProB Rodin Plugin"
],[
"de.prob2.feature"
:
"""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."""
]
]
// label and descriptions of the features
repositoryName
=
groupID
+
".repository"
// will be the folder name
parentID
=
groupID
+
".parent"
// will be the same as the folder name
targetRepositories
=
[
"http://cobra.cs.uni-duesseldorf.de/prob_dev_target/"
,
"http://download.eclipse.org/releases/indigo/"
]
// ps Repository with Target Definition File
apply
from:
'local_tasks.gradle'
apply
from:
'tycho_build.gradle'
This diff is collapsed.
Click to expand it.
build_setup.gradle
deleted
100644 → 0
+
0
−
19
View file @
1ecd8570
groupID
=
"de.prob"
features
=
[
"de.prob2.feature"
]
// must be the same as the folder name
descriptions
=
[
[
"de.prob2.feature"
:
"ProB Rodin Plugin"
],[
"de.prob2.feature"
:
"""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."""
]
]
// label and descriptions of the features
repositoryName
=
"de.prob.repository"
// will be the folder name
parentID
=
"de.prob.parent"
// will be the same as the folder name
targetRepositories
=
[
"http://cobra.cs.uni-duesseldorf.de/prob_dev_target/"
]
// ps Repository with Target Definition File
This diff is collapsed.
Click to expand it.
local_tasks.gradle
0 → 100644
+
34
−
0
View file @
cfda90ca
def
download
(
address
,
target
)
{
def
file
=
new
FileOutputStream
(
target
)
def
out
=
new
BufferedOutputStream
(
file
)
out
<<
new
URL
(
address
).
openStream
()
out
.
close
()
}
task
downloadCli
<<
{
dir
=
'de.prob.core/prob/'
delete
file
(
dir
)
new
File
(
dir
).
mkdirs
()
[
'leopard'
:
'macos'
,
'linux'
:
'linux'
,
'linux64'
:
'linux64'
,
'win32'
:
'windows'
].
each
{
n
=
it
.
getKey
()
targetdir
=
dir
+
it
.
getValue
()
targetzip
=
dir
+
"probcli_${n}.zip"
url
=
"http://nightly.cobra.cs.uni-duesseldorf.de/cli/probcli_${n}.zip"
download
(
url
,
targetzip
)
FileTree
zip
=
zipTree
(
targetzip
)
copy
{
from
zip
into
targetdir
}
delete
file
(
targetzip
)
}
}
task
collectArtifacts
(
type:
Copy
)
{
from
groupID
+
'.repository/target/repository/'
into
'updatesite'
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tycho_build.gradle
0 → 100644
+
422
−
0
View file @
cfda90ca
apply
plugin:
'base'
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
/* -- Return ParentId -- */
def
parentId
(){
return
parentID
}
/*
* This is the project of the parent Pom
* The Tycho Maven Build is triggered from
* this project's pom
*/
/* -- Return Group Id -- */
def
groupId
(){
return
groupID
}
/*
* This Group ID will be used in every sub project
*/
/////////////////////////////////////////////////////////////////////////////////////////
// -- !!! DEFINING SUB PROJECTS !!! -- //
/////////////////////////////////////////////////////////////////////////////////////////
subprojects
{
apply
plugin:
'base'
task
deleteArtifacts
(
type:
Delete
)
{
delete
'target'
,
'pom.xml'
}
task
deploy
()
<<{
description
=
"\tGenerating the Tycho Poms. Please remember to add a '.qualifier' to the version numbers!"
versionNumber
=
'Version Number Error:\tcheck Manifest for Bundle-Version Number and make sure to add a ".qualifier" to the version numbers!\n'
artifactId
=
'Could not find Bundle-SymbolicName in Manifest.file'
/* -- 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
*/
if
(
features
.
every
{
it
!=
project
.
name
}){
// Generating Poms for sub projects except features
content
=
new
File
(
"${project.name}/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
*/
}
if
(
it
==~
/Bundle-SymbolicName:.+/
){
artifactId
=
it
.
substring
(
21
)
artifactId
=
artifactId
.
replace
(
";singleton:=true"
,
''
)
}
/* Artifact ID is taken from Bundle-SymbolicName minus the
* 16 chars ';singleton:=true'
*/
}
content
.
eachLine
(
printFileLine
)
println
artifactId
println
"\t"
+
versionNumber
def
f
=
new
File
(
artifactId
+
'/pom.xml'
)
f
.
delete
()
f
<<
start
()+
elder
()+
artifact
(
artifactId
,
versionNumber
)+
end
()
/*
* old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files
*/
}
else
{
// if subprojects aren't a feature
// -- Features -- //
if
(
features
.
any
{
it
==
project
.
name
}
){
boolean
idfound
=
false
content
=
new
File
(
"${project.name}/feature.xml"
).
getText
(
"UTF-8"
)
printFileLine
=
{
if
(
it
==~
/.+version.+qualifier.+/
){
versionNumber
=
it
.
substring
(
15
,
it
.
size
()-
1
)
// possibile error: cuts off first 15 chars and leaves out last '"'
/* Version Number is taken from Feature.xml
* feature.xml is searched for version="version.qualifier"
* first 15 chars and last '"' are cut off
*/
}
if
(
it
==~
/.+id=".+/
&&
idfound
==
false
){
artifactId
=
it
.
substring
(
10
,
it
.
length
()-
1
)
idfound
=
true
}
/* Artifact ID is taken from Bundle-SymbolicName minus the
* 16 chars ';singleton:=true'
*/
}
content
.
eachLine
(
printFileLine
)
println
artifactId
println
"\t"
+
versionNumber
def
f
=
new
File
(
artifactId
+
'/pom.xml'
)
f
.
delete
()
f
<<
feature
(
artifactId
,
versionNumber
)
}
}
}
}
// defining subprojects
clean
{
dependsOn
+=
subprojects
.
deleteArtifacts
}
task
createParent
()
<<
{
// --------- define Parent --------- //
new
File
(
"${parentID}"
).
mkdir
()
versionNumber
=
'1.0.0.qualifier'
artifactId
=
parentId
()
def
f
=
new
File
(
artifactId
+
'/pom.xml'
)
f
.
delete
()
f
<<
parentPom
(
artifactId
)
for
(
int
i
=
0
;
i
<
targetRepositories
.
size
();
i
++){
f
<<
repos
(
targetRepositories
[
i
],
i
)
}
f
<<
endRepos
()
f
<<
moduleStart
()
for
(
int
i
=
0
;
i
<
numberOfProjects
();
i
++){
f
<<
module
(
projects
(
i
))
}
f
<<
module
(
repositoryName
)
f
<<
endParent
()
}
task
createRepository
()
<<
{
// ------------ define Repository --------- //
new
File
(
"${repositoryName}"
).
mkdir
()
versionNumber
=
'1.0.0.qualifier'
artifactId
=
repositoryName
featureVersionNumber
=
'1.0.0.qualifier'
def
f
=
new
File
(
artifactId
+
'/category.xml'
)
f
.
delete
()
f
<<
categoryHead
()
for
(
int
i
=
0
;
i
<
features
.
size
();
i
++){
content
=
new
File
(
"${features[i]}/feature.xml"
).
getText
(
"UTF-8"
)
printFileLine
=
{
if
(
it
==~
/.+version.+qualifier.+/
){
featureVersionNumber
=
it
.
substring
(
15
,
it
.
size
()-
1
)
// possibile error: cuts off first 15 chars and leaves out last '"'
/* Version Number is taken from Feature.xml
* feature.xml is searched for version="version.qualifier"
* first 15 chars and last '"' are cut off
*/
}
}
content
.
eachLine
(
printFileLine
)
f
<<
categoryFeatures
(
features
[
i
],
featureVersionNumber
)
}
// for
for
(
int
i
=
0
;
i
<
features
.
size
();
i
++){
f
<<
categoryDescription
(
features
[
i
],
descriptions
[
features
[
i
]][
0
]
,
descriptions
[
features
[
i
]][
1
])
// featureName, label, description
}
//for
f
<<
categoryEnd
()
def
pom
=
new
File
(
artifactId
+
'/pom.xml'
)
pom
.
delete
()
pom
<<
reposi
()
}
// end of repository definition
task
createPoms
(
dependsOn:
[
createParent
,
createRepository
,
subprojects
.
deploy
])
task
install
(
dependsOn:
[
createPoms
]
,
type:
Exec
)
{
description
=
"\tExecutes a 'mvn install' of the parent pom.xml and auto-generates Tycho Poms"
commandLine
'mvn'
,
'install'
,
'-f'
,
parentID
+
'/pom.xml'
}
//--- Defining Tycho POM parts --//
def
artifact
(
artifactId
,
versionNumber
)
{
"""
<groupId>${groupId()}</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>${groupId()}</groupId>
<artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../${parentId()}/pom.xml</relativePath>
</parent>
"""
}
def
end
()
{
"""
</project>
"""
}
// -- defining Parent Pom -- //
def
parentPom
(
artifactId
)
{
"""<?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>${groupId()}</groupId>
<artifactId>${artifactId}</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 -->
"""
}
def
repos
(
String
targetRepo
,
int
i
)
{
"""
<repository>
<id>targetRepository${i}</id>
<layout>p2</layout>
<url>${targetRepo}</url>
</repository>
"""
}
def
endRepos
()
{
"""
</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>
"""
}
def
moduleStart
(){
"""
<!-- the modules that should be built together -->
<modules>
"""
}
//for(int i = 0; i < numberOfProjects(); i++)
def
module
(
String
project
){
""" <module>../${project}</module>
"""
}
def
endParent
()
{
"""
</modules>
</project>
"""
}
// end of defining parent pom.xml
// repository Pom
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>${groupID}</groupId>
<artifactId>${parentID}</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../${parentID}/pom.xml</relativePath>
</parent>
<groupId>${groupID}</groupId>
<artifactId>${repositoryName}</artifactId>
<version>1.0.0.qualifier</version>
<packaging>eclipse-repository</packaging>
</project>
"""
}
// creates a category in
def
categoryHead
()
{
"""<?xml version="1.0" encoding="UTF-8"?>
<site>
"""
}
def
categoryFeatures
(
artifactId
,
versionNumber
){
"""
<feature url="features/${artifactId}_${versionNumber}.jar" id="${artifactId}" version="${versionNumber}">
<category name="${artifactId}.category"/>
</feature>
"""
}
def
categoryDescription
(
artifactId
,
categoryName
,
categorydescription
){
"""
<category-def name="${artifactId}.category" label="${categoryName}">
<description>
${categorydescription}
</description>
</category-def>
"""
}
def
categoryEnd
(){
"""
</site>
"""
}
// end of category definition
// feature pom
def
feature
(
artifactId
,
versionNumber
)
{
"""
<?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>${groupId()}</groupId>
<artifactId>${parentId()}</artifactId>
<version>1.0.0.qualifier</version>
<relativePath>../${parentId()}/pom.xml</relativePath>
</parent>
<groupId>${groupId()}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${versionNumber}</version>
<packaging>eclipse-feature</packaging>
</project>
"""
}
// end of feature pom
// Build Script can be executed via gradle install
// Pom Generation can be executed via gradle deploy
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment