Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relational-rags
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
relational-rags
Merge requests
!7
Resolve "Create script to include commit in version string"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Create script to include commit in version string"
20-create-script-to-include-commit-in-version-string
into
master
Overview
0
Commits
4
Pipelines
4
Changes
3
Merged
René Schöne
requested to merge
20-create-script-to-include-commit-in-version-string
into
master
5 years ago
Overview
0
Commits
4
Pipelines
4
Changes
3
Expand
Closes
#20 (closed)
Edited
5 years ago
by
René Schöne
0
0
Merge request reports
Compare
master
version 2
a9f503f3
5 years ago
version 1
702390a9
5 years ago
master (base)
and
latest version
latest version
393d870e
4 commits,
5 years ago
version 2
a9f503f3
3 commits,
5 years ago
version 1
702390a9
1 commit,
5 years ago
3 files
+
64
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
src/main/java/org/jastadd/relast/compiler/Compiler.java
+
22
−
5
Options
@@ -8,14 +8,11 @@ import org.jastadd.relast.parser.RelAstParser;
import
org.jastadd.relast.scanner.RelAstScanner
;
import
java.io.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.*
;
import
java.util.List
;
public
class
Compiler
{
private
static
final
String
VERSION
=
"0.2.4"
;
private
ArrayList
<
Option
<?>>
options
;
private
FlagOption
optionWriteToFile
;
private
FlagOption
optionPrintAST
;
@@ -35,7 +32,7 @@ public class Compiler {
commandLine
=
new
CommandLine
(
options
);
commandLine
.
parse
(
args
);
printMessage
(
"Running RelAST "
+
VERSION
);
printMessage
(
"Running RelAST "
+
readVersion
()
);
if
(
commandLine
.
getArguments
().
size
()
<
1
)
{
error
(
"specify at least one input file"
);
@@ -126,6 +123,26 @@ public class Compiler {
}
}
/**
* Reads the version string.
*
* The version string is read from the property file
* src/main/resources/Version.properties. This
* file should be generated during the build process. If it is missing
* then there is some problem in the build script.
*
* @author Jesper Öqvist <jesper.oqvist@cs.lth.se>
* @return the read version string, or <code>version ?</code>
*/
private
String
readVersion
()
{
try
{
ResourceBundle
resources
=
ResourceBundle
.
getBundle
(
"Version"
);
return
resources
.
getString
(
"version"
);
}
catch
(
MissingResourceException
e
)
{
return
"version ?"
;
}
}
public
static
void
main
(
String
[]
args
)
{
try
{
new
Compiler
(
args
);
Loading