Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Kotlin files #281

Open
wants to merge 776 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
776 commits
Select commit Hold shift + click to select a range
643b965
add test
psybers Jul 31, 2021
c101d4b
add test
psybers Jul 31, 2021
5779efe
add test
psybers Jul 31, 2021
b4b1685
add test
psybers Jul 31, 2021
6abec2c
add test
psybers Jul 31, 2021
9d55233
add test
psybers Jul 31, 2021
4b700c3
add test
psybers Jul 31, 2021
f88b7ff
add test
psybers Jul 31, 2021
208ba43
add test
psybers Jul 31, 2021
3cff151
add test
psybers Jul 31, 2021
52a454b
add test
psybers Jul 31, 2021
ab2574e
add test
psybers Jul 31, 2021
34eaca8
add test
psybers Jul 31, 2021
1b2fb42
add test
psybers Jul 31, 2021
78cc441
add test
psybers Jul 31, 2021
dcc668f
add test
psybers Jul 31, 2021
91f7468
add test
psybers Jul 31, 2021
8555241
add test
psybers Jul 31, 2021
52b476c
add test
psybers Jul 31, 2021
105940b
add test
psybers Jul 31, 2021
657bb26
add test
psybers Jul 31, 2021
3b941cd
Merge branch 'master' into kotlin
psybers Jul 31, 2021
46b953c
add test
psybers Aug 1, 2021
93827fb
add test
psybers Aug 1, 2021
f232cff
add test
psybers Aug 1, 2021
bff68bc
add test
psybers Aug 1, 2021
38b24e6
add test
psybers Aug 1, 2021
4703386
add test
psybers Aug 1, 2021
37f0785
add test
psybers Aug 1, 2021
d663f21
add test
psybers Aug 1, 2021
9fa1ac0
add test
psybers Aug 1, 2021
5110f54
add test
psybers Aug 1, 2021
0a131b2
add test
psybers Aug 1, 2021
8d310fa
add test
psybers Aug 1, 2021
74e0343
add test
psybers Aug 1, 2021
f0c9982
add test
psybers Aug 1, 2021
270f6ff
add test
psybers Aug 1, 2021
449f27f
add test
psybers Aug 1, 2021
e34e119
add test
psybers Aug 1, 2021
21f9c2f
add test
psybers Aug 1, 2021
734be81
add test
psybers Aug 1, 2021
a9a22c2
add test
psybers Aug 1, 2021
5507d10
add test
psybers Aug 1, 2021
f921a63
add test
psybers Aug 1, 2021
a0c650d
add test
psybers Aug 1, 2021
6a6d03d
add test
psybers Aug 1, 2021
e19f86f
add test
psybers Aug 1, 2021
b0e178b
add test
psybers Aug 1, 2021
4a85073
add modifiers on initializers
psybers Aug 1, 2021
65d9fd7
add test
psybers Aug 1, 2021
ce1dfa3
add test
psybers Aug 1, 2021
176ef26
add test
psybers Aug 1, 2021
a0ea1b4
add test
psybers Aug 1, 2021
18b8ae4
add test
psybers Aug 1, 2021
d68b6ee
add test
psybers Aug 1, 2021
07e0419
add test
psybers Aug 1, 2021
f9bc092
add test
psybers Aug 1, 2021
8fd454d
add test
psybers Aug 1, 2021
7a09f38
add test
psybers Aug 1, 2021
a3af6bf
add test
psybers Aug 1, 2021
7fbcf13
add test
psybers Aug 1, 2021
8121cdd
add test
psybers Aug 1, 2021
76d748b
add test
psybers Aug 1, 2021
3e75beb
add test
psybers Aug 1, 2021
b00dfeb
add TODOs
psybers Aug 2, 2021
e10cc4a
update TODOs/FIXMEs
psybers Aug 2, 2021
2d1ea31
more updates to TODOs
psybers Aug 2, 2021
1ba8e3a
avoid NPEs on type constraint lists
psybers Aug 2, 2021
6e34e0e
more work on type constraints
psybers Aug 2, 2021
64565c2
intiial type constraint support
psybers Aug 2, 2021
b1ec1f1
fix safe selector
psybers Aug 2, 2021
2723e26
undo last fix
psybers Aug 2, 2021
3ced37d
remove test
psybers Aug 2, 2021
f9d645f
add test
psybers Aug 2, 2021
1fb31ae
Add support for setting kotlin virtual filename in tests
swflint Aug 2, 2021
c644b4a
Add some thin support for script initializers
swflint Aug 2, 2021
481d10e
better type constraint handling
psybers Aug 3, 2021
7f48f9e
Improve construction of dot-qualified expressions
swflint Aug 3, 2021
1aafc7e
Add safe boolean & update safe qualified expressions to use it
swflint Aug 3, 2021
ab30f77
Safe casts are marked as a safe operation
swflint Aug 3, 2021
e252378
Updated access related tests
swflint Aug 3, 2021
e329d57
Update more qualified expressions tests
swflint Aug 3, 2021
99b2256
better generics
psybers Aug 3, 2021
331f28a
fix missing space
psybers Aug 3, 2021
f9c2e04
add test
psybers Aug 3, 2021
8cae5b4
add test
psybers Aug 3, 2021
bf73fb7
add test
psybers Aug 3, 2021
b476077
add test
psybers Aug 3, 2021
849fb1e
Update some tests
swflint Aug 3, 2021
8dfffab
Add support for lambdas in qualified expressions
swflint Aug 3, 2021
0a91256
refactor
psybers Aug 3, 2021
63442bf
remove fixme
psybers Aug 3, 2021
c54def0
simplify code
psybers Aug 3, 2021
8f9ab59
cleanup
psybers Aug 3, 2021
6323d2c
refactoring
psybers Aug 3, 2021
d1c9297
add test
psybers Aug 3, 2021
e720bd6
better typevar modifier handling
psybers Aug 3, 2021
42e33d4
remove FIXME
psybers Aug 3, 2021
2414ab5
Escape backslash
swflint Aug 3, 2021
43d5288
clone the protobuf
psybers Aug 3, 2021
d957b37
fix test
psybers Aug 3, 2021
2170ac7
add test
psybers Aug 3, 2021
431532c
fix regex
psybers Aug 3, 2021
e501da0
fix type declarations inside methods
psybers Aug 3, 2021
ddb7d40
Add some tests
swflint Aug 3, 2021
a198ea4
fix funcs defined within funcs
psybers Aug 3, 2021
ce1d46e
Add more tests
swflint Aug 3, 2021
390c373
Merge branch 'master' into kotlin
psybers Aug 3, 2021
5fbd28c
Collections examples are good
swflint Aug 5, 2021
e7566fc
IOSamples is good
swflint Aug 5, 2021
70cf754
Add some more tests
swflint Aug 5, 2021
4bb4d8a
Object declarations can have type parameters
swflint Aug 5, 2021
5f4d6a9
Update test
swflint Aug 5, 2021
d927df0
Update handling of lambdas, as well as relevant tests
swflint Aug 5, 2021
6cdfded
More tests are good
swflint Aug 5, 2021
df015a4
Add anonymous objects test
swflint Aug 5, 2021
eaff2d9
More tests are okay
swflint Aug 5, 2021
56ed0d6
Merge branch 'master' into kotlin
psybers Aug 5, 2021
c2d7682
allow running single file test
psybers Aug 5, 2021
cf40672
fix NPE
psybers Aug 5, 2021
651c8fb
fix NPE
psybers Aug 5, 2021
e836761
Add a few tests
swflint Aug 5, 2021
5a3f3eb
remove debug
psybers Aug 5, 2021
91308cc
handle generics in type aliases
psybers Aug 5, 2021
33963b6
Handle typeless property delegates
swflint Aug 5, 2021
116b6d2
cleanup code
psybers Aug 5, 2021
e6a2fb6
extension properties dont generate fields
psybers Aug 5, 2021
b7f195e
Update property delegates tests
swflint Aug 5, 2021
58310cf
A few more tests are okay
swflint Aug 5, 2021
09d2a65
Clean up expectation of expressions for method declaration arguments
swflint Aug 6, 2021
e125c88
More tests are done
swflint Aug 6, 2021
530e227
The function calls test is okay
swflint Aug 6, 2021
63c63d8
Fix destructuring in lambdas (and method definitions in general)
swflint Aug 6, 2021
0962f0f
A bunch of simple annotations are okay
swflint Aug 6, 2021
49349b2
More okay tests
swflint Aug 6, 2021
f36f9d0
Priority Queue examples are okay
swflint Aug 6, 2021
a2342f8
Add some more tests
swflint Aug 6, 2021
02f8773
add JDT settings for VSCode to force java 1.8 compilation
psybers Aug 6, 2021
b6183cb
cleanup
psybers Aug 6, 2021
b24537a
Make anonymous classes, interfaces, enums, etc possible
swflint Aug 6, 2021
4f75446
Update interface as expression
swflint Aug 6, 2021
98ddde3
More tests are okay
swflint Aug 6, 2021
fb20627
fix gettype for kotlin
psybers Aug 6, 2021
9103d73
add test
psybers Aug 6, 2021
1591d3f
Add some more tests
swflint Aug 6, 2021
bbee50e
add test
psybers Aug 6, 2021
dba98be
Handle lambdas as callees
swflint Aug 6, 2021
e9b9c87
With passes
swflint Aug 6, 2021
5cd0b8f
better string template handling
psybers Aug 6, 2021
eb19754
dont eat modifiers
psybers Aug 6, 2021
4fee766
Some more passing tests
swflint Aug 6, 2021
41c3ce7
add test
psybers Aug 6, 2021
6a7413e
add test
psybers Aug 6, 2021
d968c18
add test
psybers Aug 6, 2021
62fc4fc
add test
psybers Aug 6, 2021
bc366e2
add test
psybers Aug 6, 2021
0b3167d
add test
psybers Aug 6, 2021
afbdae7
add test
psybers Aug 6, 2021
5c05e1b
add test
psybers Aug 6, 2021
330f65c
add test
psybers Aug 6, 2021
74b173c
add test
psybers Aug 6, 2021
a0886e9
add test
psybers Aug 6, 2021
bbb033e
add test
psybers Aug 6, 2021
6ebcb89
add test
psybers Aug 6, 2021
aace300
add test
psybers Aug 6, 2021
f756859
add test
psybers Aug 6, 2021
b451649
add test
psybers Aug 6, 2021
446e1b3
add test
psybers Aug 6, 2021
c04d6bc
add test
psybers Aug 6, 2021
5a5deec
add test
psybers Aug 6, 2021
b77fb6e
add test
psybers Aug 6, 2021
5c1c834
add test
psybers Aug 6, 2021
511a0ec
add test
psybers Aug 6, 2021
c757635
add test
psybers Aug 6, 2021
31bbaa1
add test
psybers Aug 6, 2021
fd0ebf9
add test
psybers Aug 6, 2021
2cb7fcb
add test
psybers Aug 6, 2021
4830037
add test
psybers Aug 6, 2021
9bab1da
add test
psybers Aug 6, 2021
214366c
LINQ is okay
swflint Aug 6, 2021
c646ddb
A few more tests appear good
swflint Aug 6, 2021
a8083cc
change type alias to declaration
psybers Aug 6, 2021
b13c7c5
add test
psybers Aug 6, 2021
a530e3a
add test
psybers Aug 6, 2021
2d8acbc
add test
psybers Aug 6, 2021
09ec485
add test
psybers Aug 6, 2021
0f715fa
add test
psybers Aug 6, 2021
9ad6693
Add a test
swflint Aug 6, 2021
c467bd4
Add another test
swflint Aug 7, 2021
2cd75ef
Add a test for method reference in call positions
swflint Aug 7, 2021
fbab3c0
Non-name-reference method calls should behave like lambdas
swflint Aug 7, 2021
b5e3c66
Add passing tests
swflint Aug 7, 2021
b66ae9e
Create a new smaller test for constraints on a field in a class
swflint Aug 7, 2021
e0d6040
simplify testcase
psybers Aug 8, 2021
7945265
set default ast level to 15
psybers Aug 9, 2021
60db982
Throw an error if an extension property with initializers is visited
swflint Aug 9, 2021
c37e979
Merge branch 'master' into kotlin
psybers Aug 11, 2021
5f4ba20
Merge branch 'master' into kotlin
psybers Aug 13, 2021
249d7b2
Merge branch 'master' into kotlin
psybers Aug 13, 2021
37bd645
Merge branch 'master' into kotlin
psybers Aug 13, 2021
03fab8d
Merge branch 'master' into kotlin
psybers Aug 13, 2021
99ae9c4
put kotlin jars into runtime
psybers Aug 13, 2021
8f09dea
fix fragile test
psybers Aug 13, 2021
4a0f477
fix inher attrs push/pop bug
psybers Aug 13, 2021
ac54198
fix duplicate warnings
psybers Aug 14, 2021
ccc9688
better error messages for assigning to output variables
psybers Aug 14, 2021
61036ac
dont clone if -cache is used
psybers Aug 15, 2021
6d17bc9
add -recover datagen option
psybers Aug 15, 2021
cff60d8
add -skip datagen option
psybers Aug 15, 2021
0ab076c
add join() function
psybers Aug 16, 2021
546650c
remove split() and rename splitall() -> split()
psybers Aug 16, 2021
aa1a1ad
Merge branch 'master' into kotlin
psybers Sep 10, 2021
4a9719e
new hash() for AST nodes - use the byte representation instead of JSO…
psybers Sep 10, 2021
348ef23
make sure hash() returns long, not int
psybers Sep 10, 2021
660c1f9
fix crashes when requesting a snapshot that is after the last commit …
psybers Nov 16, 2021
85fba45
update the abstract visitor to visit all current child nodes of the AST
psybers Nov 22, 2021
771f29d
Annotations are now a part of the modifiers list
swflint Nov 22, 2021
efbc092
update abstract visitor for kotlin changes
psybers Nov 28, 2021
f7df682
update abstract visitor
psybers Nov 28, 2021
6de3a66
fix wrong type
psybers Nov 28, 2021
c2b6376
fix typo
psybers Nov 28, 2021
8845d65
fix field name
psybers Nov 28, 2021
06c9808
fix typo
psybers Nov 28, 2021
f3ebd4b
fix style issues
psybers Nov 28, 2021
6379c8c
fix style issues
psybers Nov 28, 2021
b40ce96
Merge branch 'master' into kotlin
psybers Nov 28, 2021
11bc854
update type mirrors for Kotlin changes
psybers Nov 28, 2021
9ac6c4b
update type mirrors for Kotlin changes
psybers Nov 28, 2021
f4de470
fix getsnapshot bug where it would go to a future commit if the times…
psybers Dec 21, 2021
9e6cf45
Merge branch 'master' into kotlin
psybers Dec 29, 2021
00f5f3a
fix some tests with typos
psybers Dec 30, 2021
4d4e829
Merge branch 'master' into kotlin
psybers Dec 30, 2021
b3c29f3
add kotlin tests to workflow
psybers Dec 30, 2021
2de2be6
remove temp file
psybers Dec 30, 2021
17a0dde
Merge branch 'master' into kotlin
psybers Jan 5, 2022
d3e3ec9
Merge branch 'master' into kotlin
psybers Jan 7, 2022
2a1f95c
Merge branch 'master' into kotlin
psybers Jan 7, 2022
db31096
Merge branch 'master' into kotlin
psybers Jan 7, 2022
8878d6a
fix prettyprint of Kotlin when statements with no condition
psybers Apr 2, 2022
d7a13c8
fix prettyprint of Kotlin labeled expressions
psybers Apr 2, 2022
01d7c66
fix fallthrough
psybers Apr 2, 2022
05786f2
fix prettyprint Kotlin throws
psybers Apr 2, 2022
0f966f0
fixing prettyprint Kotlin
psybers Apr 2, 2022
a4dc180
fixing prettyprint Kotlin
psybers Apr 2, 2022
6730174
Merge branch 'master' into kotlin
psybers Apr 3, 2022
df71c37
fix issue with generator when JSON files have single repo (not an array)
psybers May 11, 2023
df706cb
Merge branch 'master' into compiler-2021-08-Kotlin
psybers Sep 15, 2023
aa3be15
Merge branch 'kotlin' into compiler-2021-08-Kotlin
psybers Sep 15, 2023
71f853b
fix typo
psybers Sep 15, 2023
d4ecfc7
add metadata to generated jars
psybers Nov 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@
<classpathentry kind="lib" path="lib/datagen/org.eclipse.php.core.source_4.3.1.201703301037.jar"/>
<classpathentry kind="lib" path="lib/datagen/org.eclipse.text-3.5.101-sources.jar"/>
<classpathentry kind="lib" path="lib/datagen/org.eclipse.text-3.5.101.jar"/>
<classpathentry kind="lib" path="lib/datagen-kotlin/annotations-21.0.1.jar"/>
<classpathentry kind="lib" path="lib/datagen-kotlin/kotlin-compiler-1.5.20.jar"/>
<classpathentry kind="lib" path="lib/datagen-kotlin/kotlin-reflect-1.5.20.jar"/>
<classpathentry kind="lib" path="lib/datagen-kotlin/kotlin-script-runtime-1.5.20.jar"/>
<classpathentry kind="lib" path="lib/datagen-kotlin/kotlin-stdlib-1.5.20.jar"/>
<classpathentry kind="lib" path="lib/datagen-kotlin/openapi-7.0.3.jar"/>
<classpathentry kind="lib" path="lib/datagen-kotlin/trove4j-1.0.20200330.jar"/>
<classpathentry kind="lib" path="lib/datagen/protobuf-java-2.5.0.jar"/>
<classpathentry kind="lib" path="lib/datagen/slf4j-api-1.4.3.jar"/>
<classpathentry kind="lib" path="lib/datagen/slf4j-log4j12-1.4.3.jar"/>
Expand Down
14 changes: 14 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((java-mode . ((tab-width . 8)
(c-basic-offset . 8)
(indent-tabs-mode . t)
(ws-trim-mode . t)
(eval . (progn
(c-set-offset 'arglist-cont-nonempty '++)
(c-set-offset 'case-label '+)))))
(protobuf-mode . ((tab-width . 8)
(c-basic-offset . 8)
(indent-tabs-mode . t)
(ws-trim-mode . t))))
13 changes: 13 additions & 0 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ jobs:
- name: Run unit tests - datagen - Java
run: ant -noinput -buildfile build.xml -Dprotobuf.uptodate=true test-datagen-java

test-datagen-kotlin:
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
- name: Run unit tests - datagen - Kotlin
run: ant -noinput -buildfile build.xml -Dprotobuf.uptodate=true test-datagen-kotlin

test-datagen-js:
needs: compile
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/junitvmwatcher*.properties
.vscode/
/src/antlr/.antlr
.*.swp
6 changes: 6 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
2 changes: 1 addition & 1 deletion boa.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@ECHO OFF

"%JAVA_HOME%"\bin\java -cp .;"%~dp0dist\boa-compiler.jar";"%~dp0lib\*";"%~dp0lib\evaluator\*";"%~dp0lib\datagen\*";"%~dp0compile" boa.BoaMain %*
"%JAVA_HOME%"\bin\java -cp .;"%~dp0dist\boa-compiler.jar";"%~dp0lib\*";"%~dp0lib\evaluator\*";"%~dp0lib\datagen\*";"%~dp0lib\datagen-kotlin\*";"%~dp0compile" boa.BoaMain %*
pause
4 changes: 2 additions & 2 deletions boa.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#!/usr/bin/env bash

BASEDIR=$(dirname "$0")

java -cp ".:$BASEDIR/dist/boa-compiler.jar:$BASEDIR/lib/*:$BASEDIR/lib/evaluator/*:$BASEDIR/lib/datagen/*:$BASEDIR/compile" boa.BoaMain $*
java -cp ".:$BASEDIR/dist/boa-compiler.jar:$BASEDIR/lib/*:$BASEDIR/lib/evaluator/*:$BASEDIR/lib/datagen/*:$BASEDIR/lib/datagen-kotlin/*:$BASEDIR/compile" boa.BoaMain $*
91 changes: 87 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,21 @@
<fail message="Test failure detected." if="test.failed" />
</target>

<target name="test-datagen-kotlin" depends="-compile-tests" description="Run Kotlin datagen unit tests.">
<junit fork="yes" haltonfailure="no" failureproperty="test.failed">
<classpath refid="test.class.path" />
<batchtest>
<formatter type="plain" usefile="false" />
<fileset dir="build/tests">
<include name="boa/test/datagen/kotlin/Test*.class" />
<exclude name="**/*$*.class" />
</fileset>
</batchtest>
</junit>
<delete file="SecurityAuth.audit" />
<fail message="Test failure detected." if="test.failed" />
</target>

<target name="test-datagen-js" depends="-compile-tests" description="Run JavaScript datagen unit tests.">
<junit fork="yes" haltonfailure="no" failureproperty="test.failed">
<classpath refid="test.class.path" />
Expand Down Expand Up @@ -447,20 +462,36 @@


<!-- debug targets -->
<target name="java-to-boa" depends="-compile-tests" description="Convert Java code to Boa AST.">
<target name="java-to-boa" depends="-compile-tests" description="Convert Java code to Boa AST (set -Djava.code).">
<java classname="boa.test.datagen.java.JavaToBoa" fork="true" failonerror="true">
<classpath refid="test.class.path" />
<arg value="${java.code}" />
</java>
</target>

<target name="dump-java" depends="-compile-tests" description="Parse and dump Java AST.">
<target name="dump-java" depends="-compile-tests" description="Parse and dump Java AST (set -Djava.code).">
<java classname="boa.test.datagen.java.DumpJava" fork="true" failonerror="true">
<classpath refid="test.class.path" />
<arg value="${java.code}" />
</java>
</target>

<target name="kotlin-to-boa" depends="-compile-tests" description="Convert Kotlin code to Boa AST (set -Dkotlin.code, -Dkotlin.name for filename optional).">
<java classname="boa.test.datagen.kotlin.KotlinToBoa" fork="true" failonerror="true">
<classpath refid="test.class.path" />
<arg value="${kotlin.code}" />
<arg value="${kotlin.name}" />
</java>
</target>

<target name="dump-kotlin" depends="-compile-tests" description="Parse and dump Kotlin AST (set -Dkotlin.code, -Dkotlin.name for filename optional).">
<java classname="boa.test.datagen.kotlin.DumpKotlin" fork="true" failonerror="true">
<classpath refid="test.class.path" />
<arg value="${kotlin.code}" />
<arg value="${kotlin.name}" />
</java>
</target>


<!-- style checking -->
<target name="checkstyle">
Expand All @@ -473,10 +504,47 @@


<!-- packaging -->
<target name="git.revision" description="Store git revision in ${repository.version}">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="log" />
<arg value="-1" />
<arg value="--pretty=format:%H" />
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater" />
</and>
</condition>
</target>

<target name="git.branch" description="Store git branch in ${repository.branch}">
<exec executable="git" outputproperty="git.branch" failifexecutionfails="false" errorproperty="">
<arg value="branch" />
<arg value="--show-current" />
</exec>
<condition property="repository.branch" value="${git.branch}" else="unknown">
<and>
<isset property="git.branch"/>
<length string="${git.branch}" trim="yes" length="0" when="greater" />
</and>
</condition>
</target>

<target name="package" depends="package-runtime,package-compiler" description="Package both the compiler and runtime JARs."/>

<target name="package-runtime" depends="compile" description="Package the runtime JAR.">
<target name="package-runtime" depends="compile,git.branch,git.revision" description="Package the runtime JAR.">
<tstamp>
<format property="time.stamp" pattern="yyyy-MM-dd_HH:mm:ss"/>
</tstamp>
<jar destfile="dist/boa-runtime.jar">
<manifest>
<section name="boa">
<attribute name="Boa-Compiler-Branch" value="${repository.branch}" />
<attribute name="Boa-Compiler-Commit" value="${repository.version}" />
<attribute name="Boa-Compiler-CompiledDate" value="${time.stamp}" />
</section>
</manifest>
<fileset dir="build/classes">
<patternset>
<include name="boa/" />
Expand All @@ -487,13 +555,28 @@
<exclude name="**/boa/types/Boa*" />
</patternset>
</fileset>
<zipfileset excludes="META-INF/" src="lib/datagen-kotlin/annotations-21.0.1.jar" />
<zipfileset excludes="META-INF/" src="lib/datagen-kotlin/kotlin-reflect-1.5.20.jar" />
<zipfileset excludes="META-INF/" src="lib/datagen-kotlin/kotlin-stdlib-1.5.20.jar" />
<zipfileset excludes="META-INF/" src="lib/datagen-kotlin/trove4j-1.0.20200330.jar" />
<zipfileset excludes="META-INF/" src="lib/datagen-kotlin/kotlin-compiler-1.5.20.jar" />
<zipfileset excludes="META-INF/" src="lib/datagen-kotlin/kotlin-script-runtime-1.5.20.jar" />
<zipfileset excludes="META-INF/" src="lib/datagen-kotlin/openapi-7.0.3.jar" />
</jar>
</target>

<target name="package-compiler" depends="compile" description="Package the compiler JAR.">
<target name="package-compiler" depends="compile,git.branch,git.revision" description="Package the compiler JAR.">
<tstamp>
<format property="time.stamp" pattern="yyyy-MM-dd_HH:mm:ss"/>
</tstamp>
<jar destfile="dist/boa-compiler.jar">
<manifest>
<attribute name="Main-Class" value="boa.BoaMain" />
<section name="boa">
<attribute name="Boa-Compiler-Branch" value="${repository.branch}" />
<attribute name="Boa-Compiler-Commit" value="${repository.version}" />
<attribute name="Boa-Compiler-CompiledDate" value="${time.stamp}" />
</section>
</manifest>
<fileset dir="build/classes" />
<fileset dir="conf" />
Expand Down
2 changes: 1 addition & 1 deletion evaluate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [ "$#" -lt 2 ]; then
echo "Usage: $0 file.boa output-dir/ [options]"
Expand Down
Binary file added lib/datagen-kotlin/annotations-21.0.1.jar
Binary file not shown.
Binary file added lib/datagen-kotlin/kotlin-compiler-1.5.20.jar
Binary file not shown.
Binary file added lib/datagen-kotlin/kotlin-reflect-1.5.20.jar
Binary file not shown.
Binary file not shown.
Binary file added lib/datagen-kotlin/kotlin-stdlib-1.5.20.jar
Binary file not shown.
Binary file added lib/datagen-kotlin/openapi-7.0.3.jar
Binary file not shown.
Binary file added lib/datagen-kotlin/trove4j-1.0.20200330.jar
Binary file not shown.
Loading
Loading