Skip to content

Commit 3ef18c5

Browse files
authored
[jcw-gen] Build jcw-gen.exe into $(UtilityOutputFullPath) (#145)
Context: https://github.com/mono/Embeddinator-4000 Context: b6431ac Embeddinator-4000 is an in-progress utility to easily allow Java/C/Objective-C/etc. to consume .NET CIL. For example, it would be desirable to be able to "export" a `.dll` into an Android `.aar` file, so that Java developers using Android Studio can consume and use managed assemblies in a straightforward manner. Part of making this work will be to generate Java "bindings" of an assembly. "Funny" thing: we already partially have that: `jcw-gen.exe` will take an assembly and generate Java Callable Wrappers for `Java.Lang.Object` subclasses from that assembly. Aside from the base class requirement, this is (more or less) what Embeddinator-4000 requires...except that Embeddinator-4000 wants to handle *all* managed types, not just `Java.Lang.Object` subclasses. That said, at some point it will be desirable for "transparent" use of `Java.Lang.Object` subclasses; Embeddinator-4000 can't (reasonably or sanely) use it's "normal" non-`Java.Lang.Object`-aware generator to bind `Java.Lang.Object` subclasses; for starters, the base class will be completely wrong (`Java.Lang.Object` instead of `java.lang.Object`!). Embeddinator-4000 *could* use the `Java.Interop.Tools.JavaCallableWrappers` assembly in order to perform this work, but that would require that Embeddinator-4000 reference Java.Interop or otherwise "obtain" an assembly to build against, complicating bootstrapping and ongoing maintenance. Instead, Embeddinator-4000 can use our existing command-line code generation interface, `jcw-gen.exe`. This simplifies the build -- at the expense of runtime, as now you need to specify where `jcw-gen.exe` is -- and provides a "break" between repositories. Update `jcw-gen.csproj` so that it's `$(OutputPath)` is `$(UtilityOutputFullPath)`, as is the case for `class-parse`, `generator`, and `logcat-parse`, so that `jcw-gen.exe` can be distributed as part of Xamarin.Android.
1 parent e99f4a5 commit 3ef18c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/jcw-gen/jcw-gen.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
<AssemblyName>jcw-gen</AssemblyName>
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
</PropertyGroup>
14+
<Import Project="..\..\Configuration.props" />
1415
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1516
<DebugSymbols>true</DebugSymbols>
1617
<DebugType>full</DebugType>
1718
<Optimize>false</Optimize>
18-
<OutputPath>..\..\bin\Debug</OutputPath>
19+
<OutputPath>$(UtilityOutputFullPath)</OutputPath>
1920
<DefineConstants>DEBUG;</DefineConstants>
2021
<ErrorReport>prompt</ErrorReport>
2122
<WarningLevel>4</WarningLevel>
@@ -24,7 +25,7 @@
2425
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2526
<DebugType>full</DebugType>
2627
<Optimize>true</Optimize>
27-
<OutputPath>..\..\bin\Release</OutputPath>
28+
<OutputPath>$(UtilityOutputFullPath)</OutputPath>
2829
<ErrorReport>prompt</ErrorReport>
2930
<WarningLevel>4</WarningLevel>
3031
<ExternalConsole>true</ExternalConsole>

0 commit comments

Comments
 (0)