Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlc4b
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
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
tlc4b
Commits
54180ffe
Commit
54180ffe
authored
Oct 22, 2013
by
hansen
Browse files
Options
Downloads
Patches
Plain Diff
c
parent
51567e19
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.gradle
+1
-1
1 addition, 1 deletion
build.gradle
src/main/java/de/b2tla/B2TLA.java
+18
-9
18 additions, 9 deletions
src/main/java/de/b2tla/B2TLA.java
with
19 additions
and
10 deletions
build.gradle
+
1
−
1
View file @
54180ffe
...
@@ -59,7 +59,7 @@ task b2tla(dependsOn: build) << {
...
@@ -59,7 +59,7 @@ task b2tla(dependsOn: build) << {
from
(
'build/libs/'
)
from
(
'build/libs/'
)
into
(
'build/b2tla'
)
into
(
'build/b2tla'
)
include
(
'b2tla-'
+
project
.
version
+
'.jar'
)
include
(
'b2tla-'
+
project
.
version
+
'.jar'
)
rename
(
'
(
b2tla
)
-(.+)'
,
'B2TLA.jar'
)
rename
(
'b2tla-(.+)'
,
'B2TLA.jar'
)
}
}
}
}
This diff is collapsed.
Click to expand it.
src/main/java/de/b2tla/B2TLA.java
+
18
−
9
View file @
54180ffe
...
@@ -56,9 +56,13 @@ public class B2TLA {
...
@@ -56,9 +56,13 @@ public class B2TLA {
StopWatch
.
stop
(
"Translation"
);
StopWatch
.
stop
(
"Translation"
);
if
(
B2TLAGlobals
.
isRunTLC
())
{
if
(
B2TLAGlobals
.
isRunTLC
())
{
try
{
ArrayList
<
String
>
output
=
TLCRunner
.
runTLC
(
b2tla
.
machineFileNameWithoutFileExtension
,
ArrayList
<
String
>
output
=
TLCRunner
.
runTLC
(
b2tla
.
machineFileNameWithoutFileExtension
,
b2tla
.
path
);
b2tla
.
path
);
b2tla
.
evalOutput
(
output
,
true
);
b2tla
.
evalOutput
(
output
,
true
);
}
catch
(
NoClassDefFoundError
e
)
{
}
}
}
}
}
...
@@ -186,11 +190,17 @@ public class B2TLA {
...
@@ -186,11 +190,17 @@ public class B2TLA {
}
}
private
void
createFiles
()
{
private
void
createFiles
()
{
createFile
(
path
,
machineFileNameWithoutFileExtension
+
".tla"
,
tlaModule
,
"TLA+ module '"
File
moduleFile
=
createFile
(
path
,
machineFileNameWithoutFileExtension
+
".tla"
,
tlaModule
,
"TLA+ module '"
+
path
+
machineFileNameWithoutFileExtension
+
".tla' created."
,
B2TLAGlobals
.
isDeleteOnExit
());
+
path
+
machineFileNameWithoutFileExtension
+
".tla' created."
,
B2TLAGlobals
.
isDeleteOnExit
());
createFile
(
path
,
machineFileNameWithoutFileExtension
+
".cfg"
,
config
,
"Configuration file '"
if
(
moduleFile
!=
null
){
+
path
+
machineFileNameWithoutFileExtension
+
".cfg' created."
,
B2TLAGlobals
.
isDeleteOnExit
());
System
.
out
.
println
(
"TLA+ module '"
+
moduleFile
.
getAbsolutePath
()
+
"' created."
);
}
File
configFile
=
createFile
(
path
,
machineFileNameWithoutFileExtension
+
".cfg"
,
config
,
"Configuration file '"
+
path
+
machineFileNameWithoutFileExtension
+
".cfg' created."
,
B2TLAGlobals
.
isDeleteOnExit
());
if
(
configFile
!=
null
){
System
.
out
.
println
(
"Configuration file '"
+
configFile
.
getAbsolutePath
()
+
"' created."
);
}
createStandardModules
();
createStandardModules
();
}
}
...
@@ -362,19 +372,18 @@ public class B2TLA {
...
@@ -362,19 +372,18 @@ public class B2TLA {
return
res
.
toString
();
return
res
.
toString
();
}
}
public
static
void
createFile
(
String
dir
,
String
fileName
,
String
text
,
public
static
File
createFile
(
String
dir
,
String
fileName
,
String
text
,
String
message
,
boolean
deleteOnExit
)
{
String
message
,
boolean
deleteOnExit
)
{
File
d
=
new
File
(
dir
);
File
d
=
new
File
(
dir
);
d
.
mkdirs
();
d
.
mkdirs
();
File
file
=
new
File
(
dir
+
File
.
separator
+
fileName
);
File
file
=
new
File
(
dir
+
File
.
separator
+
fileName
);
System
.
out
.
println
(
"path: "
+
file
.
getAbsolutePath
());
try
{
try
{
file
.
createNewFile
();
file
.
createNewFile
();
FileWriter
fw
;
FileWriter
fw
;
fw
=
new
FileWriter
(
file
);
fw
=
new
FileWriter
(
file
);
fw
.
write
(
text
);
fw
.
write
(
text
);
fw
.
close
();
fw
.
close
();
System
.
out
.
println
(
message
)
;
return
file
;
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
B2TLAIOException
(
e
.
getMessage
());
throw
new
B2TLAIOException
(
e
.
getMessage
());
...
...
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