Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alexandru Dura
ExtendJ
Commits
18624dcd
Commit
18624dcd
authored
Oct 20, 2015
by
Jesper Öqvist
Browse files
Release 8.0.1
parent
3a8378a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
18624dcd
# build
/build
/.gradle
/bin
/ant-bin
/src/gen
/src/gen-res
/src/tmp
/doc
/build
/
/.gradle
/
/bin
/
/ant-bin
/
/src/gen
/
/src/gen-res
/
/src/tmp
/
/doc
/
/jastaddj-*.zip
/jastaddj*.jar
/fileset.tmp
/test
/test
/
# eclipse
/.classpath
...
...
build.gradle
View file @
18624dcd
...
...
@@ -14,6 +14,49 @@ apply plugin: 'application'
apply
plugin:
'jastadd'
apply
plugin:
'eclipse'
/** Helper function to run a command. Returns the command output if the command succeeded. */
def
tryCommand
(
List
command
,
boolean
failOnError
=
false
)
{
def
out
=
new
StringBuilder
()
def
err
=
new
StringBuilder
()
def
proc
=
command
.
execute
()
proc
.
waitForProcessOutput
(
out
,
err
)
if
(
proc
.
exitValue
())
{
def
msg
=
"failed to run '${command[0]}' command (args: ${command.tail()})\n$err$out"
if
(
failOnError
)
{
throw
new
GradleException
(
msg
)
}
else
{
print
'Warning: '
println
msg
}
""
}
else
{
if
(
err
)
println
"${err}"
out
.
toString
()
}
}
/** Helper function to retrieve the current version string. */
def
getVersion
()
{
if
(
hasProperty
(
'newVersion'
))
{
// A new version string should be saved.
def
versionFile
=
file
(
'src/res/Version.properties'
)
ant
.
propertyfile
(
file:
versionFile
)
{
entry
(
key:
'version'
,
value:
newVersion
)
}
return
newVersion
}
else
{
def
output
=
tryCommand
([
'git'
,
'describe'
])
if
(
output
)
{
// Use Git describe output.
output
.
readLines
()[
0
]
}
else
{
// Git command failed. Read the previous version string instead.
ant
.
property
(
file:
file
(
'src/res/Version.properties'
))
ant
.
properties
[
'version'
]
}
}
}
jastadd
{
modules
'jastadd_modules'
...
...
@@ -21,7 +64,6 @@ jastadd {
// Call Gradle with -Djastadd.module="..." to select module to build (default is "java7 backend")
// remember to run the 'clean' task if a new target module is specified!
module
=
System
.
properties
[
'jastadd.module'
]
?:
"java7 backend"
println
"Building ${module.name}"
astPackage
=
"org.extendj.ast"
genDir
=
"src/gen"
...
...
@@ -29,6 +71,10 @@ jastadd {
parser
.
name
=
"JavaParser"
}
project
.
version
=
getVersion
()
println
"Building ${module.name} version ${version}"
// Add main classes depending on target module.
if
(
jastadd
.
module
.
name
.
endsWith
(
'backend'
))
{
// Add the backend main classes.
...
...
@@ -60,7 +106,6 @@ dependencies {
sourceSets
{
main
{
resources
{
srcDir
'src/res'
srcDir
jastadd
.
buildInfoDir
}
}
...
...
@@ -68,30 +113,21 @@ sourceSets {
processResources
.
dependsOn
'updateVersionString'
// Use git describe to update the version string.
task
updateVersionString
<<
{
def
out
=
new
StringBuilder
()
def
err
=
new
StringBuilder
()
def
command
=
[
'git'
,
'describe'
]
def
proc
=
command
.
execute
()
proc
.
waitForProcessOutput
(
out
,
err
)
if
(
proc
.
exitValue
())
{
println
"warning: failed to run git describe to update version name"
println
"${err}"
}
else
{
if
(
err
)
println
"${err}"
def
outputFile
=
file
(
'src/res/Version.properties'
)
ant
.
propertyfile
(
file:
outputFile
)
{
entry
(
key:
'version'
,
value:
out
.
toString
().
readLines
()[
0
])
task
updateVersionString
{
outputs
.
upToDateWhen
{
def
props
=
new
Properties
()
def
output
=
file
(
'src/gen-res/Version.properties'
)
if
(
output
.
isFile
())
{
output
.
withInputStream
{
stream
->
props
.
load
(
stream
)
}
}
command
=
[
'git'
,
'update-index'
,
'--assume-unchanged'
,
outputFile
.
path
]
out
.
setLength
(
0
)
err
.
setLength
(
0
)
proc
=
command
.
execute
()
proc
.
waitForProcessOutput
(
out
,
err
)
if
(
proc
.
exitValue
())
{
println
'warning: git update-index failed'
println
"${err}"
props
[
'version'
]
==
project
.
version
}
doLast
{
file
(
'src/gen-res'
).
mkdirs
(
)
def
versionFile
=
file
(
'src/gen-res/Version.properties'
)
ant
.
propertyfile
(
file:
versionFile
)
{
entry
(
key:
'version'
,
value:
project
.
version
)
}
}
}
...
...
src/res/Version.properties
View file @
18624dcd
#Tue, 2
9 Sep
2015 1
3:47:35
+0200
#Tue, 2
0 Oct
2015 1
8:01:43
+0200
version
=
7.1.1-374-ge77ceb1
timestamp
=
2015-09-29T13
\:
47Z
build.date
=
2015-09-29
version
=
8.0.1
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment