Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SPB_Exchange_Repo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Amelin Konstantin
SPB_Exchange_Repo
Commits
1f54c1d0
Commit
1f54c1d0
authored
Nov 12, 2018
by
Amelin Konstantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add run.sh, run.bat. Change output jar name for assembly.
parent
75ade42f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
3 deletions
+13
-3
build.sbt
+2
-0
run.bat
+3
-0
run.sh
+3
-0
src/main/scala/Main.scala
+5
-3
No files found.
build.sbt
View file @
1f54c1d0
...
@@ -4,6 +4,8 @@ version := "0.1"
...
@@ -4,6 +4,8 @@ version := "0.1"
scalaVersion
:=
"2.12.6"
scalaVersion
:=
"2.12.6"
assemblyJarName
in
assembly
:=
"converter.jar"
libraryDependencies
+=
"org.scala-lang.modules"
%%
"scala-xml"
%
"1.1.0"
libraryDependencies
+=
"org.scala-lang.modules"
%%
"scala-xml"
%
"1.1.0"
libraryDependencies
+=
"org.scalactic"
%%
"scalactic"
%
"3.0.5"
libraryDependencies
+=
"org.scalactic"
%%
"scalactic"
%
"3.0.5"
libraryDependencies
+=
"org.scalatest"
%%
"scalatest"
%
"3.0.5"
%
"test"
libraryDependencies
+=
"org.scalatest"
%%
"scalatest"
%
"3.0.5"
%
"test"
...
...
run.bat
0 → 100644
View file @
1f54c1d0
@echo off
java -jar converter.jar %1 %2
\ No newline at end of file
run.sh
0 → 100644
View file @
1f54c1d0
#!/bin/bash
java
-jar
converter.jar
$1
$2
src/main/scala/Main.scala
View file @
1f54c1d0
...
@@ -60,7 +60,9 @@ object Main {
...
@@ -60,7 +60,9 @@ object Main {
}
}
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
if
(
args
.
length
!=
2
)
println
(
"Error: Undefined INPUT/OUTPUT directory. Usage: app INPUT OUTPUT"
)
println
(
"Converter NRD -> RTS has started..."
)
if
(
args
.
length
!=
2
)
println
(
"Error: Undefined INPUT/OUTPUT directory. Usage: run INPUT OUTPUT"
)
else
if
(!
Files
.
exists
(
Paths
.
get
(
args
(
0
))))
println
(
"Error: INPUT directory doesn`t exist"
)
else
if
(!
Files
.
exists
(
Paths
.
get
(
args
(
0
))))
println
(
"Error: INPUT directory doesn`t exist"
)
else
if
(!
Files
.
exists
(
Paths
.
get
(
args
(
1
))))
println
(
"Error: OUTPUT directory doesn`t exist"
)
else
if
(!
Files
.
exists
(
Paths
.
get
(
args
(
1
))))
println
(
"Error: OUTPUT directory doesn`t exist"
)
else
{
else
{
...
@@ -113,8 +115,8 @@ object Main {
...
@@ -113,8 +115,8 @@ object Main {
StandardOpenOption
.
CREATE
,
StandardOpenOption
.
CREATE
,
StandardOpenOption
.
TRUNCATE_EXISTING
)
StandardOpenOption
.
TRUNCATE_EXISTING
)
}
match
{
}
match
{
case
Success
(
_
)
=>
println
(
s
"
Work
has finished. $logFileName located in ${args(1)}"
)
case
Success
(
_
)
=>
println
(
s
"
Converting
has finished. $logFileName located in ${args(1)}"
)
case
Failure
(
ex
)
=>
println
(
s
"Error.
Work
hasn`t finished: ${ex.getMessage}"
)
case
Failure
(
ex
)
=>
println
(
s
"Error.
Converting
hasn`t finished: ${ex.getMessage}"
)
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
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