Skip to content

Commit

Permalink
Move to using ant build.xml for library builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Oct 7, 2015
1 parent d767e6b commit a051a8f
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 121 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
dist
build
local
_build
distribute-*
*.class
*.jar
tests/temp
org
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ python:
- "3.4"
install:
- "pip install ."
- "make"
- "ant"
script:
- "python setup.py test"
111 changes: 0 additions & 111 deletions Makefile

This file was deleted.

8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ run on any Java 1.7+ VM.

Next step - you need to compile the Python support libraries:

$ make
$ ant

This will compile `python.jar`. You will need to make sure that the python.jar
support file is in your classpath::
This will create a `dist` directory that contains `python.jar`. You will need to
make sure that this `python.jar` support file is in your classpath::

$ java -XX:-UseSplitVerifier -classpath python.jar:. python.example
$ java -XX:-UseSplitVerifier -classpath dist/python.jar:. python.example
Hello, World

The ``-CC:-UseSplitVerifier`` argument is necessary to turn off stack map
Expand Down
38 changes: 38 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<project name="MyProject" default="dist" basedir=".">
<description>
Build Python support libraries for voc
</description>
<!-- set global properties for this build -->
<property name="src" location="python"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>

<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>

<target name="compile" depends="init"
description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac includeantruntime="false" srcdir="${src}" destdir="${build}"/>
</target>

<target name="dist" depends="compile"
description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>

<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/python.jar" basedir="${build}"/>
</target>

<target name="clean"
description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>
3 changes: 1 addition & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def runAsJava(test_dir, main_code, extra_code=None):
transpiler.write(test_dir, verbosity=0)

proc = subprocess.Popen(
["java", "-classpath", "../../python.jar:.", "-XX:-UseSplitVerifier", "python.test"],
["java", "-classpath", "../../dist/python.jar:.", "-XX:-UseSplitVerifier", "python.test"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
Expand Down Expand Up @@ -285,7 +285,6 @@ def assertBinaryOperation(self, **kwargs):
vars()['test_ne_%s' % datatype] = _binary_test('test_ne_%s' % datatype, 'x != y', examples)



def _inplace_test(test_name, operation, examples):
def func(self):
for value in self.values:
Expand Down

0 comments on commit a051a8f

Please sign in to comment.