Skip to content

Instantly share code, notes, and snippets.

@lynaghk
Created May 2, 2011 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lynaghk/951638 to your computer and use it in GitHub Desktop.
Save lynaghk/951638 to your computer and use it in GitHub Desktop.
Mirah + Proguard
<?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>
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
#!/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
-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