Skip to content

Commit

Permalink
Merge pull request #248 from Microsoft/javapackage
Browse files Browse the repository at this point in the history
Javapackage
  • Loading branch information
DaveyBiggers authored Aug 2, 2016
2 parents 609e109 + 8d23bdd commit 2b1544f
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 21 deletions.
2 changes: 2 additions & 0 deletions Malmo/samples/Java_examples/JavaExamples_run_mission.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
// To run from the jar file without compiling: java -cp MalmoJavaJar.jar:JavaExamples_run_mission.jar -Djava.library.path=. JavaExamples_run_mission (on Linux)
// java -cp MalmoJavaJar.jar;JavaExamples_run_mission.jar -Djava.library.path=. JavaExamples_run_mission (on Windows)

import com.microsoft.msr.malmo.*;

public class JavaExamples_run_mission
{
static
Expand Down
44 changes: 23 additions & 21 deletions Malmo/src/JavaWrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ include( UseJava )
include( UseSWIG )
include_directories( ${JNI_INCLUDE_DIRS} )

set( CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR} )

set( JAVA_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/com/microsoft/msr/malmo )
set( CMAKE_SWIG_OUTDIR ${JAVA_OUTDIR} )
set( PACKAGE_NAME com.microsoft.msr.malmo )
# Build the SWIG C++ classes into a .so/.dll module for dynamic loading
set_source_files_properties( MalmoJava.i PROPERTIES CPLUSPLUS 1 )
if( ALE_FOUND )
set_source_files_properties( MalmoJava.i PROPERTIES SWIG_FLAGS "-DWRAP_ALE" )
endif()
set( CMAKE_SWIG_FLAGS -package ${PACKAGE_NAME} )

swig_add_module(
MalmoJava
Expand All @@ -39,27 +41,27 @@ install( TARGETS MalmoJava DESTINATION Java_Examples )

# build the SWIG Java files into a .jar
set( SWIG_JAVA_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/AgentHost.java
${CMAKE_CURRENT_BINARY_DIR}/MalmoJava.java
${CMAKE_CURRENT_BINARY_DIR}/MalmoJavaJNI.java
${CMAKE_CURRENT_BINARY_DIR}/ArgumentParser.java
${CMAKE_CURRENT_BINARY_DIR}/ByteVector.java
${CMAKE_CURRENT_BINARY_DIR}/ClientInfo.java
${CMAKE_CURRENT_BINARY_DIR}/ClientPool.java
${CMAKE_CURRENT_BINARY_DIR}/MissionRecordSpec.java
${CMAKE_CURRENT_BINARY_DIR}/MissionSpec.java
${CMAKE_CURRENT_BINARY_DIR}/ParameterSet.java
${CMAKE_CURRENT_BINARY_DIR}/TimestampedReward.java
${CMAKE_CURRENT_BINARY_DIR}/TimestampedRewardVector.java
${CMAKE_CURRENT_BINARY_DIR}/TimestampedString.java
${CMAKE_CURRENT_BINARY_DIR}/TimestampedStringVector.java
${CMAKE_CURRENT_BINARY_DIR}/TimestampedUnsignedCharVector.java
${CMAKE_CURRENT_BINARY_DIR}/TimestampedVideoFrame.java
${CMAKE_CURRENT_BINARY_DIR}/TimestampedVideoFrameVector.java
${CMAKE_CURRENT_BINARY_DIR}/WorldState.java
${JAVA_OUTDIR}/AgentHost.java
${JAVA_OUTDIR}/MalmoJava.java
${JAVA_OUTDIR}/MalmoJavaJNI.java
${JAVA_OUTDIR}/ArgumentParser.java
${JAVA_OUTDIR}/ByteVector.java
${JAVA_OUTDIR}/ClientInfo.java
${JAVA_OUTDIR}/ClientPool.java
${JAVA_OUTDIR}/MissionRecordSpec.java
${JAVA_OUTDIR}/MissionSpec.java
${JAVA_OUTDIR}/ParameterSet.java
${JAVA_OUTDIR}/TimestampedReward.java
${JAVA_OUTDIR}/TimestampedRewardVector.java
${JAVA_OUTDIR}/TimestampedString.java
${JAVA_OUTDIR}/TimestampedStringVector.java
${JAVA_OUTDIR}/TimestampedUnsignedCharVector.java
${JAVA_OUTDIR}/TimestampedVideoFrame.java
${JAVA_OUTDIR}/TimestampedVideoFrameVector.java
${JAVA_OUTDIR}/WorldState.java
)
if ( ALE_FOUND )
set( SWIG_JAVA_SOURCES ${SWIG_JAVA_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/ALEAgentHost.java )
set( SWIG_JAVA_SOURCES ${SWIG_JAVA_SOURCES} ${JAVA_OUTDIR}/ALEAgentHost.java )
endif()

add_jar(
Expand Down
2 changes: 2 additions & 0 deletions Malmo/test/JavaTests/test_ALE_built.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// --------------------------------------------------------------------------------------------------

import com.microsoft.msr.malmo.*;

public class test_ALE_built
{
static
Expand Down
2 changes: 2 additions & 0 deletions Malmo/test/JavaTests/test_agent_host.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// --------------------------------------------------------------------------------------------------

import com.microsoft.msr.malmo.*;

public class test_agent_host
{
static
Expand Down
2 changes: 2 additions & 0 deletions Malmo/test/JavaTests/test_argument_parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// --------------------------------------------------------------------------------------------------

import com.microsoft.msr.malmo.*;

public class test_argument_parser
{
static
Expand Down
2 changes: 2 additions & 0 deletions Malmo/test/JavaTests/test_mission.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// --------------------------------------------------------------------------------------------------

import com.microsoft.msr.malmo.*;

public class test_mission
{
static
Expand Down
2 changes: 2 additions & 0 deletions Malmo/test/JavaTests/test_parameter_set.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// --------------------------------------------------------------------------------------------------

import com.microsoft.msr.malmo.*;

public class test_parameter_set
{
static
Expand Down
2 changes: 2 additions & 0 deletions Malmo/test/JavaTests/test_wrapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// --------------------------------------------------------------------------------------------------

import com.microsoft.msr.malmo.*;

public class test_wrapping
{
static
Expand Down

0 comments on commit 2b1544f

Please sign in to comment.