Skip to content

Commit

Permalink
[osx-setup] Host the JDK .pkg internally
Browse files Browse the repository at this point in the history
I'd like to get Java.Interop building on a continuous integration
system, and if (when) we start building native libraries on OS X we'll
need a way to reliably, *automatically*, download the correct .pkg to
get the JavaVM.framework development headers.

Update the `make osx-setup` target to download an internally-hosted
JavaDeveloper-2013005_dp__11m4609.pkg file, and implicitly download
and extract it when needed.
  • Loading branch information
jonpryor committed Dec 18, 2015
1 parent ff4053c commit 96e0ecf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bin
obj
JavaDeveloper-2013005_dp__11m4609.pkg
LocalJDK
TestResult.xml
xa-gendarme.html
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ clean:
$(XBUILD) /t:Clean
rm -Rf bin/$(CONFIGURATION)

JDK = JavaDeveloper.pkg
JDK_URL = http://adcdownload.apple.com/Developer_Tools/java_for_os_x_2013005_developer_package/java_for_os_x_2013005_dp__11m4609.dmg
JDK = JavaDeveloper-2013005_dp__11m4609.pkg
JDK_URL = http://storage.bos.xamarin.com/android-sdk-tool/archives/JavaDeveloper-2013005_dp__11m4609.pkg

APPLE_JDK_URL = http://adcdownload.apple.com/Developer_Tools/java_for_os_x_2013005_developer_package/java_for_os_x_2013005_dp__11m4609.dmg

LOCAL_JDK_HEADERS = LocalJDK/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers

osx-setup: $(LOCAL_JDK_HEADERS)/jni.h

$(LOCAL_JDK_HEADERS)/jni.h:
@if [ ! -f $(JDK) ]; then \
echo "Please download '$(JDK)', from: $(JDK_URL)" ; \
exit 1; \
curl -o $(JDK) $(JDK_URL) ; \
fi
-mkdir LocalJDK
_jdk="$$(cd `dirname "$(JDK)"`; pwd)/`basename "$(JDK)"`" ; \
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ The `JNIEnv` API is also huge, unwieldy, and terrible.
The current Oracle JDK7 installer only provides 64-bit binaries, while
Mono for OS X is currently a 32-bit binary. These don't work together. :-(

Consequently, you must download the Apple OS X Java 6 developer package:
To quickly get a JDK that is usable with the OS X `JavaVM.framework`, run:

$ make osx-setup

If you're instead a glutton for punishment, or you need to check for
an updated `.pkg` for some future `JavaVM.framework` version:

1. Go to the [Downloads page](https://developer.apple.com/downloads/index.action).
Note: This may require you to login first.
Expand Down

0 comments on commit 96e0ecf

Please sign in to comment.