diff --git a/.travis.yml b/.travis.yml
index 819f7d0..87c3c79 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,5 +14,5 @@ before_install:
- chmod +x gradlew
after_success:
- - ./gradlew dist
+ - ./gradlew proguard
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "latest" && curl -F "file=@dist/Own-Programming-Language-Tutorial.jar" http://projects.annimon.com/samples/php/travis/upload.php?mode=ownlang
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 478a3ae..5f3177b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,11 +1,23 @@
-apply plugin: "java"
+apply plugin: 'java'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
-project.ext.mainClass = 'com.annimon.ownlang.Main'
-dependencies{
- compile fileTree(dir: 'libs', include: '*.jar')
+if (!hasProperty('mainClass')) {
+ ext.mainClass = 'com.annimon.ownlang.Main'
+}
+
+repositories {
+ jcenter()
+}
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'net.sf.proguard:proguard-gradle:5.2.1'
+ }
}
task run(dependsOn: classes, type: JavaExec) {
@@ -15,23 +27,35 @@ task run(dependsOn: classes, type: JavaExec) {
ignoreExitValue = true
}
+task runOptimizing(dependsOn: classes, type: JavaExec) {
+ main = project.mainClass
+ classpath = sourceSets.main.runtimeClasspath
+ ignoreExitValue = true
+ args '-o 9 -m -a -f program.own'.split(' ')
+}
+
task dist(dependsOn: classes, type: Jar) {
from files(sourceSets.main.output.classesDir)
from {configurations.compile.collect {zipTree(it)}}
from files(sourceSets.main.resources)
libsDirName = "$rootProject.projectDir/dist"
-
+
manifest {
attributes 'Main-Class': project.mainClass
}
}
-repositories {
- jcenter()
+task proguard(dependsOn: dist, type: proguard.gradle.ProGuardTask) {
+ configuration "$rootProject.projectDir/proguard.properties"
+ injars "$rootProject.projectDir/dist/OwnLang.jar"
+ outjars "$rootProject.projectDir/store/OwnLang.jar"
}
dependencies {
- testCompile group: 'junit', name: 'junit', version: '4.12'
- testCompile group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.12'
- testCompile group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.12'
+ compile 'com.squareup.okhttp3:okhttp:3.4.1'
+ compile 'org.json:json:20160212'
+
+ testCompile 'junit:junit:4.12'
+ testCompile 'org.openjdk.jmh:jmh-core:1.12'
+ testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.12'
}
diff --git a/build.xml b/build.xml
deleted file mode 100644
index 50045cd..0000000
--- a/build.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- Builds, tests, and runs the project OwnLang.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libs/json-20151123.jar b/libs/json-20151123.jar
deleted file mode 100644
index 472b253..0000000
Binary files a/libs/json-20151123.jar and /dev/null differ
diff --git a/libs/okhttp-3.1.2.jar b/libs/okhttp-3.1.2.jar
deleted file mode 100644
index d5d584f..0000000
Binary files a/libs/okhttp-3.1.2.jar and /dev/null differ
diff --git a/libs/okio-1.6.0.jar b/libs/okio-1.6.0.jar
deleted file mode 100644
index c87be59..0000000
Binary files a/libs/okio-1.6.0.jar and /dev/null differ
diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
deleted file mode 100644
index 89aaa15..0000000
--- a/nbproject/build-impl.xml
+++ /dev/null
@@ -1,1419 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set src.dir
- Must set test.src.dir
- Must set build.dir
- Must set dist.dir
- Must set build.classes.dir
- Must set dist.javadoc.dir
- Must set build.test.classes.dir
- Must set build.test.results.dir
- Must set build.classes.excludes
- Must set dist.jar
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- No tests executed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set JVM to use for profiling in profiler.info.jvm
- Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- To run this application from the command line without Ant, try:
-
- java -jar "${dist.jar.resolved}"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set debug.class
-
-
-
-
- Must select one file in the IDE or set debug.class
-
-
-
-
- Must set fix.includes
-
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set profile.class
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
-
- Must select some files in the IDE or set test.includes
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Some tests failed; see details above.
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set test.includes
-
-
-
- Some tests failed; see details above.
-
-
-
- Must select some files in the IDE or set test.class
- Must select some method in the IDE or set test.method
-
-
-
- Some tests failed; see details above.
-
-
-
-
- Must select one file in the IDE or set test.class
-
-
-
- Must select one file in the IDE or set test.class
- Must select some method in the IDE or set test.method
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
deleted file mode 100644
index 9e97b71..0000000
--- a/nbproject/genfiles.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-build.xml.data.CRC32=48c1b1a1
-build.xml.script.CRC32=dd12e417
-build.xml.stylesheet.CRC32=8064a381@1.78.0.48
-# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
-# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=48c1b1a1
-nbproject/build-impl.xml.script.CRC32=7fd56607
-nbproject/build-impl.xml.stylesheet.CRC32=2b19b096@1.80.0.48
diff --git a/nbproject/project.properties b/nbproject/project.properties
deleted file mode 100644
index 993fecb..0000000
--- a/nbproject/project.properties
+++ /dev/null
@@ -1,85 +0,0 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.processors.list=
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.title=OwnLang
-application.vendor=aNNiMON
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# Files in build.classes.dir which should be excluded from distribution jar
-dist.archive.excludes=
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/OwnLang.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-excludes=
-file.reference.json-20151123.jar=libs/json-20151123.jar
-file.reference.okhttp-3.1.2.jar=libs/okhttp-3.1.2.jar
-file.reference.okio-1.6.0.jar=libs/okio-1.6.0.jar
-includes=**
-jar.compress=false
-javac.classpath=\
- ${file.reference.json-20151123.jar}:\
- ${file.reference.okhttp-3.1.2.jar}:\
- ${file.reference.okio-1.6.0.jar}
-# Space-separated list of extra javac options
-javac.compilerargs=
-javac.deprecation=false
-javac.external.vm=true
-javac.processorpath=\
- ${javac.classpath}
-javac.source=1.8
-javac.target=1.8
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}:\
- ${libs.junit_4.classpath}:\
- ${libs.hamcrest.classpath}:\
- ${libs.JMH_1.12.classpath}
-javac.test.processorpath=\
- ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-main.class=com.annimon.ownlang.Main
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=false
-platform.active=default_platform
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project.
-# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
-# To set system properties for unit tests define test-sys-prop.name=value:
-run.jvmargs=
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src/main/java
-test.src.dir=src/test/java
diff --git a/nbproject/project.xml b/nbproject/project.xml
deleted file mode 100644
index 16733a7..0000000
--- a/nbproject/project.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- org.netbeans.modules.java.j2seproject
-
-
- OwnLang
-
-
-
-
-
-
-
-
-
diff --git a/proguard.properties b/proguard.properties
index aa2842b..5a0ee20 100644
--- a/proguard.properties
+++ b/proguard.properties
@@ -1,4 +1,6 @@
-target 1.8
+-libraryjars /lib/rt.jar
+-libraryjars /lib/ext/jfxrt.jar
-printmapping store/out.map
-printusage store/out.txt
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..b699976
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'OwnLang'