Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate building of idea jar #528

Merged
merged 5 commits into from
Dec 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Features
* [#512](https://github.com/java-native-access/jna/pull/512): Make loading debug flags mutable [@lwahonen](https://github.com/lwahonen).
* [#514](https://github.com/java-native-access/jna/pull/514): Added `host_processor_info` to `com.sun.jna.platform.mac.SystemB` - [@dbwiddis](https://github.com/dbwiddis).
* [#519](https://github.com/java-native-access/jna/pull/519): Added JNA functional overview - [@twall](https://github.com/twall).
* [#528](https://github.com/java-native-access/jna/pull/528): Added idea-jar ant task that creates a convenience jar that contains all native dispatch libraries - [@lwahonen](https://github.com/lwahonen).

Bug Fixes
---------
Expand Down
6 changes: 6 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,12 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
</subant>
</target>

<target name="idea-jar" depends="jar" description="Build Intellij Idea convenience jar">
<jar destfile="${dist}/idea-dispatch.jar">
<zipfileset src="${dist-jar}" excludes="**/*.class"/>
</jar>
</target>

<target name="javah" depends="compile" unless="-native">
<javah classpath="${classes}" destdir="${build.native}" force="yes">
<class name="com.sun.jna.Function"/>
Expand Down
9 changes: 9 additions & 0 deletions www/DevelopInIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Hacking on JNA with IntelliJ IDEA
======================================

The idea-jar target generates a jar that contains all the native bits needed by JNA.

Create a new module for JNA in Idea, mark the src folder as sources, testsrc as test sources.
Add a library to the module, include all jars from lib, lib/test and the idea-dispatch.jar generated by aforementioned ant target.

After this, you should be able to use JNA in your own code via this module, instead of including a JNA jar. This also speeds up development quite considerably, as you don't need to rebuild JNA jar between code changes.