/** Generates .h/.cpp files from the Java files found in "src/", with their .class files being in "bin/". The generated files * will be stored in "jni/". All paths are relative to the applications working directory. * @throws Exception */ public void generate () throws Exception { generate("src", "bin", "jni", null, null); }
/** Generates .h/.cpp fiels from the Java files found in <code>sourceDir</code>, with their .class files being in * <code>classpath</code>. The generated files will be stored in <code>jniDir</code>. All paths are relative to the * applications working directory. * @param sourceDir the directory containing the Java files * @param classpath the directory containing the .class files * @param jniDir the output directory * @throws Exception */ public void generate (String sourceDir, String classpath, String jniDir) throws Exception { generate(sourceDir, classpath, jniDir, null, null); }
/** Generates .h/.cpp fiels from the Java files found in <code>sourceDir</code>, with their .class files being in * <code>classpath</code>. The generated files will be stored in <code>jniDir</code>. All paths are relative to the * applications working directory. * @param sourceDir the directory containing the Java files * @param classpath the directory containing the .class files * @param jniDir the output directory * @throws Exception */ public void generate (String sourceDir, String classpath, String jniDir) throws Exception { generate(sourceDir, classpath, jniDir, null, null); }
/** Generates .h/.cpp files from the Java files found in "src/", with their .class files being in "bin/". The generated files * will be stored in "jni/". All paths are relative to the applications working directory. * @throws Exception */ public void generate () throws Exception { generate("src", "bin", "jni", null, null); }
public static void main(String[] args) throws Exception { // generate C/C++ code new NativeCodeGenerator().generate("src", "bin", "jni", new String[] { "**/MyJniClass.java" }, null); // generate build scripts, for win32 and linux64 only BuildConfig buildConfig = new BuildConfig("test"); BuildTarget win32 = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32.compilerPrefix = ""; win32.cppFlags += " -g"; BuildTarget lin64 = BuildTarget.newDefaultTarget(TargetOs.Linux, true); new AntScriptGenerator().generate(buildConfig, win32, lin64); // build natives BuildExecutor.executeAnt("jni/build-linux64.xml", "-v -Dhas-compiler=true clean postcompile"); BuildExecutor.executeAnt("jni/build.xml", "-v pack-natives"); // load the test-natives.jar and from it the shared library, then execute the test. new JniGenSharedLibraryLoader("libs/test-natives.jar").load("test"); ByteBuffer buffer = ByteBuffer.allocateDirect(1); buffer.put(0, (byte)8); MyJniClass.test( true, (byte)1, (char)2, (short)3, 4, 5, 6, 7, buffer, new boolean[] { false }, new char[] { 9 }, new short[] { 10 }, new int[] { 11 }, new long[] { 12 }, new float[] { 13 }, new double[] { 14 }, null, "Hurray", MyJniClass.class, new RuntimeException(), new MyJniClass()); } }
public static void main(String[] args) throws Exception { // generate C/C++ code new NativeCodeGenerator().generate("src", "bin", "jni", new String[] { "**/MyJniClass.java" }, null); // generate build scripts, for win32 and linux64 only BuildConfig buildConfig = new BuildConfig("test"); BuildTarget win32 = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32.compilerPrefix = ""; win32.cppFlags += " -g"; BuildTarget lin64 = BuildTarget.newDefaultTarget(TargetOs.Linux, true); new AntScriptGenerator().generate(buildConfig, win32, lin64); // build natives BuildExecutor.executeAnt("jni/build-linux64.xml", "-v -Dhas-compiler=true clean postcompile"); BuildExecutor.executeAnt("jni/build.xml", "-v pack-natives"); // load the test-natives.jar and from it the shared library, then execute the test. new JniGenSharedLibraryLoader("libs/test-natives.jar").load("test"); ByteBuffer buffer = ByteBuffer.allocateDirect(1); buffer.put(0, (byte)8); MyJniClass.test( true, (byte)1, (char)2, (short)3, 4, 5, 6, 7, buffer, new boolean[] { false }, new char[] { 9 }, new short[] { 10 }, new int[] { 11 }, new long[] { 12 }, new float[] { 13 }, new double[] { 14 }, null, "Hurray", MyJniClass.class, new RuntimeException(), new MyJniClass()); } }
public static void main(String[] args) throws Exception { BuildTarget win32 = BuildTarget.newDefaultTarget(TargetOs.Windows, false); BuildTarget win64 = BuildTarget.newDefaultTarget(TargetOs.Windows, true); BuildTarget lin32 = BuildTarget.newDefaultTarget(TargetOs.Linux, false); BuildTarget lin64 = BuildTarget.newDefaultTarget(TargetOs.Linux, true); BuildTarget android = BuildTarget.newDefaultTarget(TargetOs.Android, false); BuildTarget mac32 = BuildTarget.newDefaultTarget(TargetOs.MacOsX, false); BuildTarget mac64 = BuildTarget.newDefaultTarget(TargetOs.MacOsX, true); BuildTarget ios = BuildTarget.newDefaultTarget(TargetOs.IOS, false); new NativeCodeGenerator().generate("src", "bin" + File.pathSeparator + "../../../gdx/bin", "jni"); new AntScriptGenerator().generate(new BuildConfig("gdx-box2d"), win32, win64, lin32, lin64, mac32, mac64, android, ios); } }
public static void main (String[] args) throws Exception { new NativeCodeGenerator().generate("src", "bin", "jni");
public static void main (String[] args) throws Exception { new NativeCodeGenerator().generate("src", "bin", "jni");
public static void main (String[] args) throws Exception { new NativeCodeGenerator().generate("src/", "bin/", "jni/"); BuildConfig buildConfig = new BuildConfig("gdx-controllers-desktop");
new NativeCodeGenerator().generate("src", "bin", JNI_DIR, new String[] {"**/*"}, null);
new NativeCodeGenerator().generate("src", "bin", JNI_DIR, new String[] {"**/*"}, null);
ios.cppFlags += " -DFT2_BUILD_LIBRARY"; new NativeCodeGenerator().generate("src", "bin:../../gdx/bin", "jni"); new AntScriptGenerator().generate(new BuildConfig("gdx-freetype"), win32home, win32, win64, lin32, lin64, mac, mac64, android, ios);
ios.cppFlags += " -DFT2_BUILD_LIBRARY"; new NativeCodeGenerator().generate("src", "bin:../../gdx/bin", "jni"); new AntScriptGenerator().generate(new BuildConfig("gdx-freetype"), win32home, win32, win64, lin32, lin64, mac, mac64, android, ios);
/** Generates .h/.cpp fiels from the Java files found in <code>sourceDir</code>, with their .class files being in * <code>classpath</code>. The generated files will be stored in <code>jniDir</code>. All paths are relative to the * applications working directory. * @param sourceDir the directory containing the Java files * @param classpath the directory containing the .class files * @param jniDir the output directory * @throws Exception */ public void generate (String sourceDir, String classpath, String jniDir) throws Exception { generate(sourceDir, classpath, jniDir, null, null); }
/** Generates .h/.cpp files from the Java files found in "src/", with their .class files being in "bin/". The generated files * will be stored in "jni/". All paths are relative to the applications working directory. * @throws Exception */ public void generate () throws Exception { generate("src", "bin", "jni", null, null); }
public static void main(String[] arguments) { try { new NativeCodeGenerator().generate( "java-wrapper/src/main/java", "java-wrapper/target/classes", "java-wrapper/src/main/native", new String[] { "**/*.java" }, new String[] { "**/SteamSharedLibraryLoader.java" }); new NativeCodeGenerator().generate( "server/src/main/java", "server/target/classes", "server/src/main/native", new String[] { "**/*Native.java" }, null); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } }
public static void main(String[] args) throws Exception { // generate C/C++ code new NativeCodeGenerator().generate("src", "bin", "jni", new String[] { "**/MyJniClass.java" }, null); // generate build scripts, for win32 and linux64 only BuildConfig buildConfig = new BuildConfig("test"); BuildTarget win32 = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32.compilerPrefix = ""; win32.cppFlags += " -g"; BuildTarget lin64 = BuildTarget.newDefaultTarget(TargetOs.Linux, true); new AntScriptGenerator().generate(buildConfig, win32, lin64); // build natives BuildExecutor.executeAnt("jni/build-linux64.xml", "-v -Dhas-compiler=true clean postcompile"); BuildExecutor.executeAnt("jni/build.xml", "-v pack-natives"); // load the test-natives.jar and from it the shared library, then execute the test. new JniGenSharedLibraryLoader("libs/test-natives.jar").load("test"); ByteBuffer buffer = ByteBuffer.allocateDirect(1); buffer.put(0, (byte)8); MyJniClass.test( true, (byte)1, (char)2, (short)3, 4, 5, 6, 7, buffer, new boolean[] { false }, new char[] { 9 }, new short[] { 10 }, new int[] { 11 }, new long[] { 12 }, new float[] { 13 }, new double[] { 14 }, null, "Hurray", MyJniClass.class, new RuntimeException(), new MyJniClass()); } }
public static void main(String[] args) throws Exception { BuildTarget win32 = BuildTarget.newDefaultTarget(TargetOs.Windows, false); BuildTarget win64 = BuildTarget.newDefaultTarget(TargetOs.Windows, true); BuildTarget lin32 = BuildTarget.newDefaultTarget(TargetOs.Linux, false); BuildTarget lin64 = BuildTarget.newDefaultTarget(TargetOs.Linux, true); BuildTarget android = BuildTarget.newDefaultTarget(TargetOs.Android, false); BuildTarget mac32 = BuildTarget.newDefaultTarget(TargetOs.MacOsX, false); BuildTarget mac64 = BuildTarget.newDefaultTarget(TargetOs.MacOsX, true); BuildTarget ios = BuildTarget.newDefaultTarget(TargetOs.IOS, false); new NativeCodeGenerator().generate("src", "bin" + File.pathSeparator + "../../../gdx/bin", "jni"); new AntScriptGenerator().generate(new BuildConfig("gdx-box2d"), win32, win64, lin32, lin64, mac32, mac64, android, ios); } }
new NativeCodeGenerator().generate("src", "bin", JNI_DIR, new String[] {"**/*"}, null);