Created
May 2, 2011 13:57
-
-
Save lynaghk/951638 to your computer and use it in GitHub Desktop.
Mirah + Proguard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<project name="pgtest" basedir="." default="jar"> | |
<!-- ===================================================================== --> | |
<!-- | BUILD PROPERTIES | --> | |
<!-- ===================================================================== --> | |
<!-- Define local properties --> | |
<property name="dir.libs" location="${basedir}/lib" /> | |
<property name="dir.src" location="${basedir}/src" /> | |
<property name="dir.build" location="${basedir}/build" /> | |
<property name="dir.build.classes" location="${dir.build}/classes" /> | |
<property name="file.output" location="${dir.build}/pgtest.jar" /> | |
<!-- ===================================================================== --> | |
<!-- | BUILD TARGETS | --> | |
<!-- ===================================================================== --> | |
<target name="compile" description="copies mirah complied class files to build dir."> | |
<mkdir dir="${dir.build.classes}" /> | |
<copy todir="${dir.build.classes}"> | |
<fileset dir="${dir.src}"> | |
<include name="**/*" /> | |
<exclude name="**/*.mirah" /> | |
</fileset> | |
</copy> | |
</target> | |
<target name="jar" description="Jars a file for a developer application"> | |
<jar basedir="${dir.build.classes}" destfile="${file.output}"> | |
<manifest> | |
<attribute name="Main-Class" value="src.com.pgtest.Main" /> | |
</manifest> | |
</jar> | |
</target> | |
<target name="clean" description="Cleans the build directory."> | |
<delete dir="${dir.build}" /> | |
</target> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package "com.pgtest" | |
class Rubyisms | |
macro def attr_reader(name) | |
quote do | |
def `name` | |
@`name` | |
end | |
end | |
end | |
end | |
class Main | |
def create | |
System.err.println "hi there" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
export JRUBY_OPTS="" | |
mirahc --jvm 1.4 \ | |
--classpath $(JARS=(lib/*.jar); IFS=:; echo "${JARS[*]}") \ | |
`find src/com/ -name "*.mirah"` | |
mkdir -p build/classes | |
mv com/ build/classes/ | |
ant jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-injars build/pgtest.jar | |
-libraryjars lib/ | |
-libraryjars /home/kevin/software/mirah/javalib/mirah-parser.jar | |
-libraryjars /home/kevin/software/mirah/javalib/mirah-bootstrap.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment