Skip to content
Commits on Source (5)
This diff is collapsed.
hawtjni (1.17-1) unstable; urgency=medium
* New upstream release
- New dependency on libcommons-lang-java
* Standards-Version updated to 4.4.0
-- Emmanuel Bourg <ebourg@apache.org> Thu, 18 Jul 2019 11:24:35 +0200
hawtjni (1.16-1) unstable; urgency=medium
* New upstream release
......
......@@ -7,11 +7,12 @@ Build-Depends:
default-jdk,
debhelper (>= 11),
libasm-java,
libcommons-lang-java,
libmaven-plugin-tools-java,
libplexus-component-metadata-java,
libxbean-java,
maven-debian-helper (>= 2.2)
Standards-Version: 4.3.0
Standards-Version: 4.4.0
Vcs-Git: https://salsa.debian.org/java-team/hawtjni.git
Vcs-Browser: https://salsa.debian.org/java-team/hawtjni
Homepage: http://fusesource.com/forge/sites/hawtjni/
......@@ -28,7 +29,7 @@ Description: Java library that provide JNI code generation
Package: libhawtjni-generator-java
Architecture: all
Depends: ${misc:Depends}, libhawtjni-runtime-java, libasm-java, libcommons-cli-java, libxbean-java
Depends: ${misc:Depends}, libhawtjni-runtime-java, libasm-java, libcommons-cli-java, libcommons-lang-java, libxbean-java
Description: HawtJNI Generator
HawtJNI is a code generator that produces the JNI code
needed to implement java native methods. It is based on the
......
Description: Adds the missing dependency on commons-lang
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: https://github.com/fusesource/hawtjni/issues/58
--- a/hawtjni-generator/pom.xml
+++ b/hawtjni-generator/pom.xml
@@ -64,6 +64,11 @@
<artifactId>commons-cli</artifactId>
<version>1.0</version>
</dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>debian</version>
+ </dependency>
</dependencies>
<build>
02-commons-lang-dependency.patch
......@@ -21,7 +21,7 @@
<parent>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>hawtjni-project</artifactId>
<version>1.16</version>
<version>1.17</version>
</parent>
<artifactId>hawtjni-example</artifactId>
......
......@@ -222,6 +222,9 @@ public class Example {
@JniField(cast="struct foo *")
public long prev;
@JniField(getter = "get_d()", setter = "set_d()", flags = { GETTER_NONMEMBER, SETTER_NONMEMBER })
private float d;
@Override
public int hashCode() {
final int prime = 31;
......@@ -231,6 +234,7 @@ public class Example {
result = prime * result + Arrays.hashCode(c);
result = prime * result + c5;
result = prime * result + (int) (prev ^ (prev >>> 32));
result = prime * result + Float.valueOf(d).hashCode();
return result;
}
......@@ -253,12 +257,15 @@ public class Example {
return false;
if (prev != other.prev)
return false;
if (d != other.d) {
return false;
}
return true;
}
@Override
public String toString() {
return "foo [a=" + a + ", b=" + b + ", c=" + Arrays.toString(c) + ", c5=" + c5 + ", prev=" + prev + "]";
return "foo [a=" + a + ", b=" + b + ", c=" + Arrays.toString(c) + ", c5=" + c5 + ", prev=" + prev + ", d=" + d + "]";
}
}
......@@ -282,7 +289,7 @@ public class Example {
@JniMethod(cast = "char *")
public static final native long char_add(@JniArg(cast="char *")long ptr, int count);
@JniClass(flags={ClassFlag.STRUCT, ClassFlag.TYPEDEF})
@JniClass(flags={ClassFlag.STRUCT, ClassFlag.TYPEDEF})
static public class point {
static {
LIBRARY.load();
......@@ -326,4 +333,15 @@ public class Example {
public static final native void passingtheenv (String msg, JNIEnv env);
@JniClass(flags={ClassFlag.STRUCT})
static class ClassWithAccessors {
static {
LIBRARY.load();
}
@JniField(getter = "get_e()", setter = "set_e()")
private float e;
}
}
......@@ -9,8 +9,14 @@
#include "foo.h"
#include <stdio.h>
float get_d(struct foo *arg) {
return 0.0f;
}
void set_d(struct foo *arg, float d) {
}
void print_foo(struct foo *arg) {
printf("foo@%p: { a: %d, b: %d, c: \"%s\", prev: @%p}\n", arg, arg->a, (int)arg->b, arg->c, arg->prev);
printf("foo@%p: { a: %d, b: %d, c: \"%s\", prev: @%p, d: %f}\n", arg, arg->a, (int)arg->b, arg->c, arg->prev, get_d(arg));
}
long foowork(struct foo **arg, int count) {
......
......@@ -20,7 +20,7 @@ struct foo {
int a;
size_t b;
char c[20];
struct foo *prev;
struct foo *prev;
};
typedef struct _point {
......@@ -28,6 +28,19 @@ typedef struct _point {
int y;
} point;
struct ClassWithAccessors {
float e;
float (*get_e)();
void (*set_e)(float e);
};
float get_d(struct foo *arg);
void set_d(struct foo *arg, float d);
float ClassWithAccessors_get_e(struct foo *arg);
void ClassWithAccessors_set_e(struct foo *arg, float e);
struct foo * foo_add(struct foo *arg, int count);
char * char_add(char *arg, int count);
......
......@@ -21,7 +21,7 @@
<parent>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>hawtjni-project</artifactId>
<version>1.16</version>
<version>1.17</version>
</parent>
<artifactId>hawtjni-generator</artifactId>
......
......@@ -16,6 +16,7 @@ import java.util.List;
import org.fusesource.hawtjni.generator.model.JNIClass;
import org.fusesource.hawtjni.generator.model.JNIField;
import org.fusesource.hawtjni.generator.model.JNIFieldAccessor;
import org.fusesource.hawtjni.generator.model.JNIMethod;
import org.fusesource.hawtjni.generator.model.JNIParameter;
import org.fusesource.hawtjni.generator.model.JNIType;
......@@ -189,9 +190,7 @@ public class NativesGenerator extends JNIGenerator {
boolean allowConversion = !type.equals(type64);
String simpleName = type.getSimpleName();
String accessor = field.getAccessor();
if (accessor == null || accessor.length() == 0)
accessor = field.getName();
JNIFieldAccessor accessor = field.getAccessor();
String fieldId = "(*env)->GetStaticFieldID(env, that, \""+field.getName()+"\", \""+type.getTypeSignature(allowConversion)+"\")";
if (isCPP) {
......@@ -208,7 +207,7 @@ public class NativesGenerator extends JNIGenerator {
if( field.isPointer() ) {
output("(intptr_t)");
}
output(accessor);
output(accessor.getter());
output(");");
} else if (type.isArray()) {
......@@ -238,7 +237,7 @@ public class NativesGenerator extends JNIGenerator {
} else {
output("ArrayRegion(env, lpObject1, 0, sizeof(");
}
output(accessor);
output(accessor.getter());
output(")");
if (!componentType.isType("byte")) {
output(" / sizeof(");
......@@ -248,7 +247,7 @@ public class NativesGenerator extends JNIGenerator {
output(", (");
output(type.getTypeSignature4(allowConversion, false));
output(")");
output(accessor);
output(accessor.getter());
outputln(");");
output("\t}");
} else {
......@@ -268,7 +267,7 @@ public class NativesGenerator extends JNIGenerator {
output("\tif (lpObject1 != NULL) set");
output(simpleName);
output("Fields(env, lpObject1, &lpStruct->");
output(accessor);
output(accessor.getter());
outputln(");");
output("\t}");
}
......
......@@ -12,10 +12,12 @@ package org.fusesource.hawtjni.generator;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.fusesource.hawtjni.generator.model.JNIClass;
import org.fusesource.hawtjni.generator.model.JNIField;
import org.fusesource.hawtjni.generator.model.JNIFieldAccessor;
import org.fusesource.hawtjni.generator.model.JNIType;
import org.fusesource.hawtjni.runtime.ClassFlag;
......@@ -29,6 +31,8 @@ public class StructsGenerator extends JNIGenerator {
static final boolean GLOBAL_REF = false;
private HashMap<JNIClass, ArrayList<JNIField>> structFields = new HashMap<JNIClass, ArrayList<JNIField>>();
public StructsGenerator(boolean header) {
this.header = header;
}
......@@ -60,15 +64,19 @@ public class StructsGenerator extends JNIGenerator {
}
private ArrayList<JNIField> getStructFields(JNIClass clazz) {
ArrayList<JNIField> rc = new ArrayList<JNIField>();
List<JNIField> fields = clazz.getDeclaredFields();
for (JNIField field : fields) {
int mods = field.getModifiers();
if ( (mods & Modifier.STATIC) == 0 && (mods & Modifier.TRANSIENT) == 0) {
rc.add(field);
if (!structFields.containsKey(clazz)) {
ArrayList<JNIField> rc = new ArrayList<JNIField>();
List<JNIField> fields = clazz.getDeclaredFields();
for (JNIField field : fields) {
int mods = field.getModifiers();
if ((mods & Modifier.STATIC) == 0 && (mods & Modifier.TRANSIENT) == 0) {
rc.add(field);
}
}
structFields.put(clazz, rc);
}
return rc;
return structFields.get(clazz);
}
void generateHeaderFile(JNIClass clazz) {
......@@ -165,13 +173,14 @@ public class StructsGenerator extends JNIGenerator {
outputln("_FID_CACHE {");
outputln("\tint cached;");
outputln("\tjclass clazz;");
output("\tjfieldID ");
List<JNIField> fields = clazz.getDeclaredFields();
boolean first = true;
for (JNIField field : fields) {
if (ignoreField(field))
continue;
if (!first)
if (first)
output("\tjfieldID ");
else
output(", ");
output(field.getName());
first = false;
......@@ -193,7 +202,7 @@ public class StructsGenerator extends JNIGenerator {
output(simpleName);
outputln("Fc.cached) return;");
JNIClass superclazz = clazz.getSuperclass();
if (!superclazz.getName().equals("java.lang.Object")) {
if (!superclazz.getName().equals("java.lang.Object") && hasNonIgnoredFields(superclazz)) {
String superName = superclazz.getSimpleName();
output("\tcache");
output(superName);
......@@ -252,7 +261,8 @@ public class StructsGenerator extends JNIGenerator {
JNIClass superclazz = clazz.getSuperclass();
String clazzName = clazz.getNativeName();
String superName = superclazz.getNativeName();
if (!superclazz.getName().equals("java.lang.Object")) {
String methodname;
if (!superclazz.getName().equals("java.lang.Object") && hasNonIgnoredFields(superclazz)) {
/*
* Windows exception - cannot call get/set function of super class
* in this case
......@@ -277,15 +287,22 @@ public class StructsGenerator extends JNIGenerator {
}
JNIType type = field.getType(), type64 = field.getType64();
String simpleName = type.getSimpleName();
String accessor = field.getAccessor();
if (accessor == null || accessor.length() == 0)
accessor = field.getName();
JNIFieldAccessor accessor = field.getAccessor();
output("\t");
if (type.isPrimitive()) {
output("\tlpStruct->");
output(accessor);
output(" = ");
if (!accessor.isNonMemberSetter())
output("lpStruct->");
if (accessor.isMethodSetter()) {
String setterStart = accessor.setter().split("\\(")[0];
output(setterStart + "(");
if (accessor.isNonMemberSetter())
output("lpStruct, ");
} else {
output(accessor.setter());
output(" = ");
}
output(field.getCast());
if( field.isPointer() ) {
if (field.isPointer()) {
output("(intptr_t)");
}
if (isCPP) {
......@@ -302,11 +319,13 @@ public class StructsGenerator extends JNIGenerator {
output(field.getDeclaringClass().getSimpleName());
output("Fc.");
output(field.getName());
if (accessor.isMethodSetter())
output(")");
output(");");
} else if (type.isArray()) {
JNIType componentType = type.getComponentType(), componentType64 = type64.getComponentType();
if (componentType.isPrimitive()) {
outputln("\t{");
outputln("{");
output("\t");
output(type.getTypeSignature2(!type.equals(type64)));
output(" lpObject1 = (");
......@@ -327,11 +346,13 @@ public class StructsGenerator extends JNIGenerator {
}
output(componentType.getTypeSignature1(!componentType.equals(componentType64)));
if (isCPP) {
output("ArrayRegion(lpObject1, 0, sizeof(lpStruct->");
output("ArrayRegion(lpObject1, 0, sizeof(");
} else {
output("ArrayRegion(env, lpObject1, 0, sizeof(lpStruct->");
output("ArrayRegion(env, lpObject1, 0, sizeof(");
}
output(accessor);
if (!accessor.isNonMemberGetter())
output("lpStruct->");
output(accessor.getter());
output(")");
if (!componentType.isType("byte")) {
output(" / sizeof(");
......@@ -340,8 +361,10 @@ public class StructsGenerator extends JNIGenerator {
}
output(", (");
output(type.getTypeSignature4(!type.equals(type64), false));
output(")lpStruct->");
output(accessor);
output(")");
if (!accessor.isNonMemberGetter())
output("lpStruct->");
output(accessor.getter());
outputln(");");
output("\t}");
} else {
......@@ -361,7 +384,7 @@ public class StructsGenerator extends JNIGenerator {
output("\tif (lpObject1 != NULL) get");
output(simpleName);
output("Fields(env, lpObject1, &lpStruct->");
output(accessor);
output(accessor.getter());
outputln(");");
output("\t}");
}
......@@ -405,7 +428,7 @@ public class StructsGenerator extends JNIGenerator {
JNIClass superclazz = clazz.getSuperclass();
String clazzName = clazz.getNativeName();
String superName = superclazz.getNativeName();
if (!superclazz.getName().equals("java.lang.Object")) {
if (!superclazz.getName().equals("java.lang.Object") && hasNonIgnoredFields(superclazz)) {
/*
* Windows exception - cannot call get/set function of super class
* in this case
......@@ -432,9 +455,7 @@ public class StructsGenerator extends JNIGenerator {
boolean allowConversion = !type.equals(type64);
String simpleName = type.getSimpleName();
String accessor = field.getAccessor();
if (accessor == null || accessor.length() == 0)
accessor = field.getName();
JNIFieldAccessor accessor = field.getAccessor();
if (type.isPrimitive()) {
if (isCPP) {
output("\tenv->Set");
......@@ -455,7 +476,17 @@ public class StructsGenerator extends JNIGenerator {
if( field.isPointer() ) {
output("(intptr_t)");
}
output("lpStruct->"+accessor);
if (!accessor.isNonMemberGetter())
output("lpStruct->");
if (accessor.isMethodGetter()) {
String getterStart = accessor.getter().split("\\(")[0];
output(getterStart + "(");
if (accessor.isNonMemberGetter())
output("lpStruct");
output(")");
} else {
output(accessor.getter());
}
output(");");
} else if (type.isArray()) {
JNIType componentType = type.getComponentType(), componentType64 = type64.getComponentType();
......@@ -481,11 +512,21 @@ public class StructsGenerator extends JNIGenerator {
}
output(componentType.getTypeSignature1(!componentType.equals(componentType64)));
if (isCPP) {
output("ArrayRegion(lpObject1, 0, sizeof(lpStruct->");
output("ArrayRegion(lpObject1, 0, sizeof(");
} else {
output("ArrayRegion(env, lpObject1, 0, sizeof(");
}
if (!accessor.isNonMemberGetter())
output("lpStruct->");
if (accessor.isMethodGetter()) {
String getterStart = accessor.getter().split("\\(")[0];
output(getterStart + "(");
if (accessor.isNonMemberGetter())
output("lpStruct");
output(")");
} else {
output("ArrayRegion(env, lpObject1, 0, sizeof(lpStruct->");
output(accessor.getter());
}
output(accessor);
output(")");
if (!componentType.isType("byte")) {
output(" / sizeof(");
......@@ -494,8 +535,10 @@ public class StructsGenerator extends JNIGenerator {
}
output(", (");
output(type.getTypeSignature4(allowConversion, false));
output(")lpStruct->");
output(accessor);
output(")");
if (!accessor.isNonMemberGetter())
output("lpStruct->");
output(accessor.getter());
outputln(");");
output("\t}");
} else {
......@@ -515,7 +558,7 @@ public class StructsGenerator extends JNIGenerator {
output("\tif (lpObject1 != NULL) set");
output(simpleName);
output("Fields(env, lpObject1, &lpStruct->");
output(accessor);
output(accessor.getter());
outputln(");");
output("\t}");
}
......@@ -560,4 +603,10 @@ public class StructsGenerator extends JNIGenerator {
return field.ignore() || ((mods & Modifier.FINAL) != 0) || ((mods & Modifier.STATIC) != 0);
}
boolean hasNonIgnoredFields(JNIClass clazz) {
for (JNIField field : getStructFields(clazz))
if (!ignoreField(field)) return true;
return false;
}
}
......@@ -27,7 +27,7 @@ public interface JNIField {
public JNIType getType64();
public JNIClass getDeclaringClass();
public String getAccessor();
public JNIFieldAccessor getAccessor();
public String getCast();
public String getConditional();
public boolean ignore();
......
package org.fusesource.hawtjni.generator.model;
/**
* @author <a href="mailto:calin.iorgulescu@gmail.com">Calin Iorgulescu</a>
*/
public interface JNIFieldAccessor {
public String getter();
public String setter();
public boolean isNonMemberGetter();
public boolean isNonMemberSetter();
public boolean isMethodGetter();
public boolean isMethodSetter();
}
......@@ -14,6 +14,7 @@ import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.HashSet;
import org.apache.commons.lang.StringUtils;
import org.fusesource.hawtjni.runtime.FieldFlag;
import org.fusesource.hawtjni.runtime.JniField;
import org.fusesource.hawtjni.runtime.T32;
......@@ -33,6 +34,7 @@ public class ReflectField implements JNIField {
private JniField annotation;
private HashSet<FieldFlag> flags;
private boolean allowConversion;
private ReflectFieldAccessor accessor;
public ReflectField(ReflectClass parent, Field field) {
this.parent = parent;
......@@ -78,8 +80,8 @@ public class ReflectField implements JNIField {
return type.asType64(allowConversion);
}
public String getAccessor() {
return annotation == null ? "" : annotation.accessor();
public JNIFieldAccessor getAccessor() {
return accessor;
}
public String getCast() {
......@@ -95,7 +97,7 @@ public class ReflectField implements JNIField {
if( annotation == null ) {
return false;
}
return getFlag(POINTER_FIELD) || ( type.getWrappedClass() == Long.TYPE && getCast().endsWith("*)") );
return getFlag(POINTER_FIELD) || ( type.getWrappedClass() == Long.TYPE && getCast().endsWith("*") );
}
public String getConditional() {
......@@ -128,8 +130,19 @@ public class ReflectField implements JNIField {
this.type = new ReflectType(field.getType());
this.annotation = this.field.getAnnotation(JniField.class);
this.flags = new HashSet<FieldFlag>();
this.accessor = new ReflectFieldAccessor(this.field.getName());
if( this.annotation!=null ) {
this.flags.addAll(Arrays.asList(this.annotation.flags()));
if (!StringUtils.isEmpty(this.annotation.accessor())) {
this.accessor = new ReflectFieldAccessor(this.annotation.accessor());
} else if (!StringUtils.isEmpty(this.annotation.getter()) &&
!StringUtils.isEmpty(this.annotation.setter())) {
this.accessor = new ReflectFieldAccessor(
this.annotation.getter(),
this.flags.contains(GETTER_NONMEMBER),
this.annotation.setter(),
this.flags.contains(SETTER_NONMEMBER));
}
}
allowConversion = this.field.getAnnotation(T32.class)!=null;
......
package org.fusesource.hawtjni.generator.model;
/**
* @author <a href="mailto:calin.iorgulescu@gmail.com">Calin Iorgulescu</a>
*/
public class ReflectFieldAccessor implements JNIFieldAccessor {
private String getter;
private String setter;
private boolean nonMemberGetter;
private boolean nonMemberSetter;
public ReflectFieldAccessor(String value) {
this.getter = this.setter = value;
this.nonMemberGetter = this.nonMemberSetter = false;
}
public ReflectFieldAccessor(String getter, boolean nonMemberGetter, String setter, boolean nonMemberSetter) {
this.getter = getter;
this.nonMemberGetter = nonMemberGetter;
this.setter = setter;
this.nonMemberSetter = nonMemberSetter;
}
public String getter() {
return getter;
}
public String setter() {
return setter;
}
public boolean isNonMemberGetter() {
return nonMemberGetter;
}
public boolean isNonMemberSetter() {
return nonMemberSetter;
}
public boolean isMethodGetter() {
return getter.contains("(");
}
public boolean isMethodSetter() {
return setter.contains("(");
}
}
......@@ -21,7 +21,7 @@
<parent>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>hawtjni-project</artifactId>
<version>1.16</version>
<version>1.17</version>
</parent>
<artifactId>hawtjni-maven-plugin</artifactId>
......
......@@ -258,7 +258,9 @@ public class BuildMojo extends AbstractMojo {
if( vcinstalldir!=null ) {
if( vcinstalldir.contains("Microsoft Visual Studio 10") ||
vcinstalldir.contains("Microsoft Visual Studio 11") ||
vcinstalldir.contains("Microsoft Visual Studio 12")
vcinstalldir.contains("Microsoft Visual Studio 12") ||
vcinstalldir.contains("Microsoft Visual Studio 14") ||
vcinstalldir.contains("Microsoft Visual Studio\\2017")
) {
useMSBuild = true;
}
......@@ -286,8 +288,6 @@ public class BuildMojo extends AbstractMojo {
}
}
File libFile=FileUtils.resolveFile(buildDir, "target/"+platform+"-"+configuration+"/lib/"+library.getLibraryFileName());
if( !libFile.exists() ) {
throw new MojoExecutionException("vcbuild did not generate: "+libFile);
......@@ -318,7 +318,7 @@ public class BuildMojo extends AbstractMojo {
File distDirectory = new File(buildDir, "target");
File distLibDirectory = new File(distDirectory, "lib");
distLibDirectory.mkdirs();
distLibDirectory.mkdirs();
if( autogen.exists() && !skipAutogen ) {
if( (!configure.exists() && !CLI.IS_WINDOWS) || forceAutogen ) {
......
......@@ -148,7 +148,7 @@ public class GenerateMojo extends AbstractMojo {
/**
* The build tool to use on Windows systems. Set
* to 'msbuild', 'vcbuild', or 'detect'
* to 'msbuild', 'vcbuild', or 'detect' or 'none'
*/
@Parameter(defaultValue = "detect")
private String windowsBuildTool;
......@@ -160,6 +160,33 @@ public class GenerateMojo extends AbstractMojo {
*/
@Parameter
private String windowsProjectName;
/**
* Set this value to true to include the import of a custom properties file in your vcxproj (not applicable
* to vs2008). This greatly simplifies the configurability of your project.
*/
@Parameter(defaultValue = "false")
private boolean windowsCustomProps;
/**
* The tools version used in the header of your vcxproj (not applicable to vs2008).
*/
@Parameter(defaultValue = "4.0")
private String windowsToolsVersion;
/**
* The target platform version used in your vcxproj (not applicable to vs2008).
* Not supplied by default.
*/
@Parameter
private String windowsTargetPlatformVersion;
/**
* The platform toolset version used in your vcxproj (not applicable to vs2008).
* Not supplied by default.
*/
@Parameter
private String windowsPlatformToolset;
private File targetSrcDir;
......@@ -235,8 +262,14 @@ public class GenerateMojo extends AbstractMojo {
if( "detect".equals(tool) ) {
copyTemplateResource("vs2008.vcproj", (windowsProjectName != null ? windowsProjectName : "vs2008") + ".vcproj", true);
copyTemplateResource("vs2010.vcxproj", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".vcxproj", true);
if (windowsCustomProps) {
copyTemplateResource("vs2010.custom.props", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".custom.props", true);
}
} else if( "msbuild".equals(tool) ) {
copyTemplateResource("vs2010.vcxproj", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".vcxproj", true);
if (windowsCustomProps) {
copyTemplateResource("vs2010.custom.props", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".custom.props", true);
}
} else if( "vcbuild".equals(tool) ) {
copyTemplateResource("vs2008.vcproj", (windowsProjectName != null ? windowsProjectName : "vs2008") + ".vcproj", true);
} else if( "none".equals(tool) ) {
......@@ -340,8 +373,8 @@ public class GenerateMojo extends AbstractMojo {
}
sources += " src/"+f;
xml_sources+=" <File RelativePath=\".\\src\\"+ (f.replace('/', '\\')) +"\"/>\n";
vs10_sources+=" <ClCompile Include=\".\\src\\"+ (f.replace('/', '\\')) +"\"/>\n";
xml_sources+=" <File RelativePath=\".\\src\\"+ (f.replace('/', '\\')) +"\" />\n";
vs10_sources+=" <ClCompile Include=\".\\src\\"+ (f.replace('/', '\\')) +"\" />\n"; //VS adds trailing space and eases compares
}
if( cpp_files.isEmpty() ) {
......@@ -353,8 +386,16 @@ public class GenerateMojo extends AbstractMojo {
values.put("PROJECT_SOURCES", sources);
values.put("PROJECT_XML_SOURCES", xml_sources);
values.put("PROJECT_VS10_SOURCES", vs10_sources);
FileUtils.FilterWrapper wrapper = new FileUtils.FilterWrapper() {
values.put("CUSTOM_PROPS", windowsCustomProps ? "<Import Project=\"" +
(windowsProjectName != null ? windowsProjectName : "vs2010") + ".custom.props\" />" : "");
values.put("TOOLS_VERSION", windowsToolsVersion);
values.put("TARGET_PLATFORM_VERSION", windowsTargetPlatformVersion != null ?
"<WindowsTargetPlatformVersion>" + windowsTargetPlatformVersion + "</WindowsTargetPlatformVersion>" : "");
values.put("PLATFORM_TOOLSET", windowsPlatformToolset != null ?
"<PlatformToolset>" + windowsPlatformToolset + "</PlatformToolset>" : "");
FileUtils.FilterWrapper wrapper = new FileUtils.FilterWrapper() {
public Reader getReader(Reader reader) {
StringSearchInterpolator propertiesInterpolator = new StringSearchInterpolator(startExp, endExp);
propertiesInterpolator.addValueSource(new MapBasedValueSource(values));
......
......@@ -53,7 +53,7 @@ AC_DEFUN([WITH_OSX_UNIVERSAL],
],[
OSX_SDKS_DIR=""
OSX_VERSION=""
for v in 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11 10.12; do
for v in 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11 10.12 10.13 10.14; do
for location in "/Developer/SDKs" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" ; do
if test -z "${OSX_VERSION}" && test -d "${location}/MacOSX${v}.sdk" ; then
OSX_SDKS_DIR="${location}"
......