1- <?xml version =" 1.0" encoding =" utf-8" ?>
2- <Project DefaultTargets =" Build" ToolsVersion =" 4.0" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
1+ <Project Sdk =" Microsoft.Build.NoTargets/1.0.110" >
32 <PropertyGroup >
4- <Configuration Condition =" '$(Configuration)' == '' " >Debug</Configuration >
5- <Platform Condition =" '$(Platform)' == '' " >AnyCPU</Platform >
6- <ItemType >GenericProject</ItemType >
7- <ProductVersion >8.0.30703</ProductVersion >
8- <SchemaVersion >2.0</SchemaVersion >
9- <ProjectGuid >{BB0AB9F7-0979-41A7-B7A9-877260655F94}</ProjectGuid >
10- </PropertyGroup >
11- <Import Project =" ..\..\Directory.Build.props" />
12- <PropertyGroup Condition =" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " >
13- <DebugSymbols >true</DebugSymbols >
3+ <TargetFramework >net472</TargetFramework >
144 <OutputPath >$(ToolOutputFullPath)</OutputPath >
155 <JNIEnvGenPath >$(BuildToolOutputFullPath)</JNIEnvGenPath >
166 <OutputName >java-interop</OutputName >
17- <CompileTarget >SharedLibrary</CompileTarget >
18- <DefineSymbols >DEBUG JI_DLL_EXPORT MONODEVELOP MONO_DLL_EXPORT</DefineSymbols >
7+ <DefineSymbols >JI_DLL_EXPORT MONODEVELOP MONO_DLL_EXPORT</DefineSymbols >
198 <SourceDirectory >.</SourceDirectory >
209 </PropertyGroup >
10+
11+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " >
12+ <DefineConstants >DEBUG $(DefineConstants)</DefineConstants >
13+ </PropertyGroup >
14+
2115 <PropertyGroup Condition =" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " >
22- <OutputPath >$(ToolOutputFullPath)</OutputPath >
23- <OutputName >java-interop</OutputName >
24- <JNIEnvGenPath >$(BuildToolOutputFullPath)</JNIEnvGenPath >
25- <CompileTarget >SharedLibrary</CompileTarget >
2616 <OptimizationLevel >3</OptimizationLevel >
27- <DefineSymbols >JI_DLL_EXPORT MONODEVELOP MONO_DLL_EXPORT</DefineSymbols >
28- <SourceDirectory >.</SourceDirectory >
2917 </PropertyGroup >
18+
3019 <ItemGroup >
3120 <ClInclude Include =" java-interop.h" />
3221 <ClInclude Include =" java-interop-gc-bridge.h" />
3322 <ClInclude Include =" java-interop-mono.h" />
3423 </ItemGroup >
24+
3525 <PropertyGroup >
3626 <_MonoIncludePath >@(MonoIncludePath->'%(FullPath)')</_MonoIncludePath >
3727 <_JdkIncludePath >@(JdkIncludePath->'%(FullPath)')</_JdkIncludePath >
3828 </PropertyGroup >
29+
3930 <ItemDefinitionGroup >
4031 <ClCompile >
4132 <PreprocessorDefinitions >$([MSBuild]::Unescape($(DefineSymbols.Replace(' ', ';'))))</PreprocessorDefinitions >
4233 <AdditionalIncludeDirectories >$([MSBuild]::Unescape($(_MonoIncludePath)));$([MSBuild]::Unescape($(_JdkIncludePath)))</AdditionalIncludeDirectories >
4334 </ClCompile >
4435 </ItemDefinitionGroup >
36+
4537 <ItemGroup >
4638 <ClCompile Include =" jni.c" />
4739 <ClCompile Include =" java-interop.cc" />
5042 <ClCompile Include =" java-interop-mono.cc" />
5143 <ClCompile Include =" java-interop-gc-bridge-mono.cc" />
5244 </ItemGroup >
53- <PropertyGroup >
54- <BuildDependsOn >
55- BuildJni_c;
56- BuildMac;
57- BuildUnixLibraries;
58- $(BuildDependsOn)
59- </BuildDependsOn >
60- </PropertyGroup >
61- <Import Project =" java-interop.targets" />
45+
6246 <ItemGroup >
63- <ProjectReference Include =" ..\..\build-tools\jnienv-gen\jnienv-gen.csproj" >
64- <Project >{6410DA0F-5E14-4FC0-9AEE-F4C542C96C7A}</Project >
65- <Name >jnienv-gen</Name >
66- <ReferenceOutputAssembly >False</ReferenceOutputAssembly >
67- </ProjectReference >
47+ <ProjectReference Include =" ..\..\build-tools\jnienv-gen\jnienv-gen.csproj" ReferenceOutputAssembly =" false" />
6848 </ItemGroup >
69- </Project >
49+
50+ <Target Name =" BuildJni_c"
51+ Inputs =" $(JNIEnvGenPath)\jnienv-gen.exe"
52+ Outputs =" jni.c" >
53+ <MakeDir Directories =" $(OutputPath)" />
54+ <Exec Command =" $(Runtime) " $(JNIEnvGenPath)\jnienv-gen.exe" jni.g.cs jni.c" />
55+ </Target >
56+
57+ <PropertyGroup >
58+ <_MacLib >$(OutputPath)\lib$(OutputName).dylib</_MacLib >
59+ </PropertyGroup >
60+
61+ <Target Name =" _CompileObjectFiles"
62+ Condition =" '$(OS)' != 'Windows_NT' "
63+ DependsOnTargets =" BuildJni_c"
64+ Inputs =" @(ClCompile)"
65+ Outputs =" obj\$(Configuration)\%(Filename).o" >
66+ <MakeDir Directories =" obj\$(Configuration)" />
67+ <ItemGroup >
68+ <_Defines Include =" %(ClCompile.PreprocessorDefinitions)" />
69+ <_Includes Include =" %(ClCompile.AdditionalIncludeDirectories)" />
70+ </ItemGroup >
71+ <PropertyGroup >
72+ <_Arch Condition =" Exists ('/Library/Frameworks/') " >-m64</_Arch >
73+ <_Cc Condition =" '%(ClCompile.Extension)' == '.c' " >gcc -std=c99 -fPIC</_Cc >
74+ <_Cc Condition =" '%(ClCompile.Extension)' == '.cc' " >g++ -std=c++11 -fPIC</_Cc >
75+ <_Def >@(_Defines->'-D%(Identity)', ' ')</_Def >
76+ <_Inc >@(_Includes->'-I "%(Identity)"', ' ')</_Inc >
77+ </PropertyGroup >
78+ <Exec Command =" $(_Cc) -c -g $(_Arch) -o " obj\$(Configuration)\%(ClCompile.Filename).o" $(_Def) $(_Inc) " %(Identity)" " />
79+ </Target >
80+
81+ <Target Name =" BuildMac" AfterTargets =" Build"
82+ Condition =" '$(OS)' != 'Windows_NT' And Exists ('/Library/Frameworks/')"
83+ DependsOnTargets =" _CompileObjectFiles"
84+ Inputs =" @(ClCompile)"
85+ Outputs =" $(_MacLib)" >
86+ <PropertyGroup >
87+ <_LinkFlags >-fvisibility=hidden -Wl,-undefined -Wl,suppress -Wl,-flat_namespace</_LinkFlags >
88+ <_Libs >$(MonoLibs)</_Libs >
89+ <_Files >@(ClCompile->'obj\$(Configuration)\%(Filename).o', ' ')</_Files >
90+ </PropertyGroup >
91+ <Exec Command =" gcc -g -shared -m64 -std=c99 -fPIC -o " $(_MacLib)" $(_LinkFlags) $(_Libs) $(_Files)" />
92+ <!-- Mono 4.4.0 (mono-4.4.0-branch/a3fabf1) has an incorrect shared library name. Fix it -->
93+ <Exec Command =" install_name_tool -change /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/package-root/lib/libmonosgen-2.0.1.dylib /Library/Frameworks/Mono.framework/Libraries/libmonosgen-2.0.1.dylib " $(_MacLib)" " />
94+ </Target >
95+
96+ <Target Name =" BuildUnixLibraries" AfterTargets =" Build"
97+ Condition =" '$(OS)' != 'Windows_NT' And !Exists ('/Library/Frameworks/')"
98+ DependsOnTargets =" _CompileObjectFiles"
99+ Inputs =" @(ClCompile)"
100+ Outputs =" $(OutputPath)\lib$(OutputName).so" >
101+ <PropertyGroup >
102+ <_FixedDefines >$(DefineSymbols.Split(' '))</_FixedDefines >
103+ </PropertyGroup >
104+ <ItemGroup >
105+ <_Defines Include =" $(_FixedDefines)" />
106+ </ItemGroup >
107+ <PropertyGroup >
108+ <_LinkFlags >-fvisibility=hidden -Wl,-undefined -Wl,suppress -Wl,-flat_namespace -fPIC</_LinkFlags >
109+ <_Libs >$(MonoLibs)</_Libs >
110+ <_Files >@(ClCompile->'obj\$(Configuration)\%(Filename).o', ' ')</_Files >
111+ </PropertyGroup >
112+ <Exec Command =" g++ -g -shared -o " $(OutputPath)\lib$(OutputName).so" $(_LinkFlags) $(_Libs) $(_Files)" />
113+ </Target >
114+
115+ <Target Name =" Clean" >
116+ <RemoveDir Directories =" obj" />
117+ <Delete Files =" jni.c" />
118+ <Delete
119+ Files =" $(OutputPath)\lib$(OutputName).dylib"
120+ Condition =" '$(OS)' != 'Windows_NT' "
121+ />
122+ </Target >
123+
124+ </Project >
0 commit comments