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 build-with ant task #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Generated files:
/target
/classes
*_TEST.java
/x86_64-apple-darwin12.4.0
/x86_64-unknown-linux-gnu
test-outputs
/bootstrap
/test_server/*.beam
*/.erjang/*.jar
erjang.log
*.beam
erjang*.jar
otp*.jar
src/main/java/erjang/beam/interpreter

# IDE specifics:
/.idea
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ Total time: 20 seconds
````
Then, just run `java -jar erjang-R16B01.jar`

Or you can build it with a local erlang distribution. Use the build-with ant task with an src parameter pointing at the erlang distribution's directory:

````
>which erl
/usr/lib/erlang/bin

>ant build-with -Dsrc=/usr/lib/erlang
...
BUILD SUCCESSFUL
````

### How does it work?

It loads Erlang's binary `.beam` file format, compiles it into Java's `.class` file format, and loads it into the JVM. It will eventually have it's own implementation of all Erlang's BIFs (built-in-functions) written in Java.
Expand Down
21 changes: 20 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
</jar>
</target>

<target name="otpjar" depends="get_otp_version">
<target name="otpjar">
<jar jarfile="otp-${erjang.otp.version}.jar" basedir="${erjang.otp.root}">
<exclude name="**/*.so" />
<exclude name="**/*.dll" />
Expand All @@ -330,6 +330,9 @@
</target>

<target name="alljar" depends="jar,otpjar">
<property name="erjang.otp.root" value="${basedir}/${otp_arch}" />
<antcall target="get_otp_version" />
<antcall target="otpjar" />
<jar jarfile="erjang-${erjang.otp.version}.jar" basedir="${erjang.otp.root}">
<!-- include all of erjang -->
<zipgroupfileset dir="." includes="erjang-${erjang.version}.jar" />
Expand All @@ -342,6 +345,22 @@
</jar>
</target>

<target name="build-with" if="isLinux" depends="arch">
<property name="erjang.otp.root" value="${basedir}/${otp_arch}" />
<symlink link="${otp_arch}" resource="${src}" overwrite="true"/>
<antcall target="jar" />
<antcall target="otpjar" />
<jar jarfile="erjang.jar" basedir="${erjang.otp.root}">
<!-- include all of erjang -->
<zipgroupfileset dir="." includes="erjang-${erjang.version}.jar" />
<!-- include all of OTP -->
<zipgroupfileset dir="." includes="otp.jar" />
<manifest>
<attribute name="Main-Class" value="erjang.Main" />
</manifest>
</jar>
</target>

<target name="javadoc" description="generate Javadoc documentation">
<javadoc destdir="target/doc">
<fileset dir="src"><include name="**/*.java"/></fileset>
Expand Down