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
0dafa7fe
Commit
0dafa7fe
authored
12 years ago
by
Lukas Ladenberger
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' of github.com:bendisposto/prob into develop
parents
180e02d8
aaa4e6cb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tycho_build.gradle
+76
-19
76 additions, 19 deletions
tycho_build.gradle
with
76 additions
and
19 deletions
tycho_build.gradle
+
76
−
19
View file @
0dafa7fe
...
...
@@ -128,8 +128,9 @@ def groupId(){
* This Group ID will be used in every sub project
*/
def
addLibToCP
(
def
project
,
File
filePar
,
def
libPar
){
def
addLibToCP
(
def
project
,
def
libPar
){
def
filePar
=
new
File
(
workspacePath
+
project
+
"/.classpath"
)
boolean
notYetAdded
=
true
filePar
.
eachLine
{
line
->
def
pattern
=
".*${dependencyFolder}${libPar}.*"
...
...
@@ -139,26 +140,61 @@ def addLibToCP(def project, File filePar, def libPar){
}
if
(
notYetAdded
){
File
newCP
=
new
File
(
project
+
'/.cp'
)
File
newCP
=
new
File
(
workspacePath
+
project
+
'/.cp'
)
filePar
.
eachLine
{
line
->
if
(
line
==~
/.*<\/classpath>.*/
){
String
entry
=
'<classpathentry exported="true" kind="lib" path="
lib/
dependenc
ies/'
+
libPar
+
'"/>'
+
'\n</classpath>\n'
String
entry
=
'
\t
<classpathentry exported="true" kind="lib" path="
'
+
dependenc
yFolder
+
libPar
+
'"/>'
+
'\n</classpath>\n'
line
=
line
.
replaceAll
(
/<\/classpath>/
,
entry
)
println
line
newCP
<<
line
+
"\n"
println
project
+
" : "
+
libPar
+
" added to classpath"
newCP
<<
line
}
else
{
newCP
<<
line
+
"\n"
}
}
filePar
.
delete
()
newCP
.
renameTo
(
project
+
'/.classpath'
)
newCP
.
renameTo
(
workspacePath
+
project
+
'/.classpath'
)
}
else
{
println
project
+
" : "
+
libPar
+
" classpath entry already present"
}
}
def
deleteLibFromCP
(
def
project
){
def
filePar
=
new
File
(
workspacePath
+
project
+
"/.classpath"
)
boolean
deleteCP
=
false
def
newCP
=
new
File
(
workspacePath
+
project
+
'/cp'
)
def
pattern
=
".*${dependencyFolder}[^<].*/>"
filePar
.
eachLine
{
line
->
if
(
line
==~
/\n(\ |\t)*/
)
line
=
line
.
replaceAll
(
/\n(\ |\t)*/
,
''
)
// delete empty lines
if
(
line
==~
/${pattern}/
){
deleteCP
=
true
def
pattern2
=
'(\\ |\\t)*<classpathentry exported="true" kind="lib" path="'
+
dependencyFolder
+
"[^<].*"
+
'"/>(\\ |\\t)*'
line
=
line
.
replaceAll
(
/${pattern2}/
,
''
)
newCP
<<
line
}
else
{
newCP
<<
line
+
"\n"
}
}
if
(!
deleteCP
){
println
project
+
" : no dependencies from "
+
dependencyFolder
+
" found in classpath file! "
newCP
.
delete
()
}
else
{
filePar
.
delete
()
newCP
.
renameTo
(
workspacePath
+
project
+
'/.classpath'
)
println
workspacePath
+
project
+
'/.classpath'
+
"!"
}
}
/////////////////////////////////////////////////////////////////////////////////////////
// -- !!! DEFINING SUB PROJECTS !!! -- //
/////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -167,7 +203,7 @@ subprojects {
apply
plugin:
'base'
apply
plugin:
'java'
apply
plugin:
'eclipse'
//
apply plugin: 'eclipse'
task
deleteArtifacts
(
type:
Delete
)
{
delete
'target'
,
'pom.xml'
...
...
@@ -183,22 +219,22 @@ subprojects {
}
task
setClassPath
(
dependsOn:
'collectDependencies'
){
task
setClassPath
(
dependsOn:
'collectDependencies'
)<<{
description
=
"\tAdds all your Dependencies from your local lib folder in each project to it's classpath"
def
dependencyList
=
[]
try
{
def
dir
=
new
File
(
project
.
name
+
"/"
+
dependencyFolder
).
eachFile
()
{
file
->
def
dir
=
new
File
(
workspacePath
+
project
.
name
+
"/"
+
dependencyFolder
).
eachFile
()
{
file
->
dependencyList
<<
file
.
getName
()
}
if
(
features
.
every
{
it
!=
project
.
name
}){
def
cpFile
=
new
File
(
project
.
name
+
"/.classpath"
)
for
(
int
icp
=
0
;
icp
<
dependencyList
.
size
;
icp
++){
addLibToCP
(
project
.
name
,
cpFile
,
dependencyList
[
icp
])
addLibToCP
(
project
.
name
,
dependencyList
[
icp
])
}
/*dependencyList.each{ dep->
println project.name+": "+ dep
println project.name+": "+ dep
// could still be usefull for debugging, that's why it's not deleted
}*/
}
...
...
@@ -208,12 +244,33 @@ subprojects {
}
// setClassPath
eclipse
.
classpath
.
file
{
whenMerged
{
classpath
->
classpath
.
entries
.
findAll
{
entry
->
entry
.
kind
==
'lib'
}*.
exported
=
true
task
deleteFromClassPath
()<<{
//AKTUELLE BAUSTELLE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !! !! !! !!!!!!!!!!!!!!!!!!######!!!!#!!!
description
=
"\tDeletes all your Dependencies located in your local lib folder from each project's classpath"
try
{
boolean
depsDelete
=
false
def
depsFolder
=
new
File
(
workspacePath
+
project
.
name
+
'/'
+
dependencyFolder
)
if
(
depsFolder
.
exists
())
depsDelete
=
true
depsFolder
.
deleteDir
()
if
(
features
.
every
{
it
!=
project
.
name
}
&&
depsDelete
){
deleteLibFromCP
(
project
.
name
)
}
}
catch
(
Exception
e
){
println
project
.
name
+
" has no dependencies in '${dependencyFolder}' defined: Classpath will not be changed"
}
}
task
flushDependencies
(
dependsOn:
[
'deleteFromClassPath'
])<<{
tasks
.
setClassPath
.
execute
()
}
////////////////////////////////////////////////////////////////////////////////////////////
task
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