How can I generate both Android and pure Java libraries from a single code base?How can I concatenate two arrays in Java?How do I call one constructor from another in Java?How do I create a Java string from the contents of a file?How do I generate random integers within a specific range in Java?How to create a generic array in Java?How to get an enum value from a string value in Java?Why is the Android emulator so slow? How can we speed up the Android emulator?How to avoid Java code in JSP files?Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?Combining jars from multiple modules in Android Studio

Should I dumb down my writing in a foreign country?

Nominativ or Akkusativ

Has a commercial or military jet bi-plane ever been manufactured?

How can internet speed be 10 times slower without a router than when using a router?

Should homeowners insurance cover the cost of the home?

How do LIGO and VIRGO know that a gravitational wave has its origin in a neutron star or a black hole?

Out of scope work duties and resignation

SafeCracker #3 - We've Been Blocked

Why does this derived table improve performance?

How can I support myself financially as a 17 year old with a loan?

Will 700 more planes a day fly because of the Heathrow expansion?

In Russian, how do you idiomatically express the idea of the figurative "overnight"?

Why does sound not move through a wall?

Does a picture or painting work with Wild Shape?

How to safely wipe a USB flash drive

IP addresses from public IP block in my LAN

Emotional immaturity of comic-book version of superhero Shazam

Is there an idiom that support the idea that "inflation is bad"?

What is the solution to this metapuzzle from a university puzzling column?

What are the differences between credential stuffing and password spraying?

Why aren't nationalizations in Russia described as socialist?

Why is "breaking the mould" positively connoted?

How to use dependency injection and avoid temporal coupling?

How long would it take for people to notice a mass disappearance?



How can I generate both Android and pure Java libraries from a single code base?


How can I concatenate two arrays in Java?How do I call one constructor from another in Java?How do I create a Java string from the contents of a file?How do I generate random integers within a specific range in Java?How to create a generic array in Java?How to get an enum value from a string value in Java?Why is the Android emulator so slow? How can we speed up the Android emulator?How to avoid Java code in JSP files?Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?Combining jars from multiple modules in Android Studio






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am working with a codebase that is Java bindings for a native library. From this single codebase I would like to generate:



  • jars for several Android ABIs

  • jars for x86 on Windows, Mac and a Linux OSs

The artifacts must include both the Java bindings and the appropriate variant of the native library: arm/android, x86/linux, etc.



I am able to accomplish this feat with a gradle project that looks like this:



project
|
+ - build.gradle (does roughly nothing)
|
+ - art
| + - build.gradle (uses ndk/cmake to build jars for Android)
|
+ - jvm
| + - build.gradle (uses gradle java and native to build jars for the JVM)
|
+ - src (the source from which both of the modules are built)


That is, two modules that contain nothing except build scripts, both of which build exactly the same source.



This seems somewhat clumsy. I've attempted to combine the two builds.gradle files, but:



> The 'java' plugin has been applied, but it is not compatible with the Android plugins.


Is there a more straightforward way of configuring this build?



(EDITED to remove the "aar" red herring)










share|improve this question
























  • Android is perfectly capable of using jar files. The only reason to need AARs is if you have resources to include.

    – Gabe Sechan
    Mar 23 at 0:13

















0















I am working with a codebase that is Java bindings for a native library. From this single codebase I would like to generate:



  • jars for several Android ABIs

  • jars for x86 on Windows, Mac and a Linux OSs

The artifacts must include both the Java bindings and the appropriate variant of the native library: arm/android, x86/linux, etc.



I am able to accomplish this feat with a gradle project that looks like this:



project
|
+ - build.gradle (does roughly nothing)
|
+ - art
| + - build.gradle (uses ndk/cmake to build jars for Android)
|
+ - jvm
| + - build.gradle (uses gradle java and native to build jars for the JVM)
|
+ - src (the source from which both of the modules are built)


That is, two modules that contain nothing except build scripts, both of which build exactly the same source.



This seems somewhat clumsy. I've attempted to combine the two builds.gradle files, but:



> The 'java' plugin has been applied, but it is not compatible with the Android plugins.


Is there a more straightforward way of configuring this build?



(EDITED to remove the "aar" red herring)










share|improve this question
























  • Android is perfectly capable of using jar files. The only reason to need AARs is if you have resources to include.

    – Gabe Sechan
    Mar 23 at 0:13













0












0








0








I am working with a codebase that is Java bindings for a native library. From this single codebase I would like to generate:



  • jars for several Android ABIs

  • jars for x86 on Windows, Mac and a Linux OSs

The artifacts must include both the Java bindings and the appropriate variant of the native library: arm/android, x86/linux, etc.



I am able to accomplish this feat with a gradle project that looks like this:



project
|
+ - build.gradle (does roughly nothing)
|
+ - art
| + - build.gradle (uses ndk/cmake to build jars for Android)
|
+ - jvm
| + - build.gradle (uses gradle java and native to build jars for the JVM)
|
+ - src (the source from which both of the modules are built)


That is, two modules that contain nothing except build scripts, both of which build exactly the same source.



This seems somewhat clumsy. I've attempted to combine the two builds.gradle files, but:



> The 'java' plugin has been applied, but it is not compatible with the Android plugins.


Is there a more straightforward way of configuring this build?



(EDITED to remove the "aar" red herring)










share|improve this question
















I am working with a codebase that is Java bindings for a native library. From this single codebase I would like to generate:



  • jars for several Android ABIs

  • jars for x86 on Windows, Mac and a Linux OSs

The artifacts must include both the Java bindings and the appropriate variant of the native library: arm/android, x86/linux, etc.



I am able to accomplish this feat with a gradle project that looks like this:



project
|
+ - build.gradle (does roughly nothing)
|
+ - art
| + - build.gradle (uses ndk/cmake to build jars for Android)
|
+ - jvm
| + - build.gradle (uses gradle java and native to build jars for the JVM)
|
+ - src (the source from which both of the modules are built)


That is, two modules that contain nothing except build scripts, both of which build exactly the same source.



This seems somewhat clumsy. I've attempted to combine the two builds.gradle files, but:



> The 'java' plugin has been applied, but it is not compatible with the Android plugins.


Is there a more straightforward way of configuring this build?



(EDITED to remove the "aar" red herring)







java android gradle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 4:21







G. Blake Meike

















asked Mar 22 at 23:50









G. Blake MeikeG. Blake Meike

5,29631837




5,29631837












  • Android is perfectly capable of using jar files. The only reason to need AARs is if you have resources to include.

    – Gabe Sechan
    Mar 23 at 0:13

















  • Android is perfectly capable of using jar files. The only reason to need AARs is if you have resources to include.

    – Gabe Sechan
    Mar 23 at 0:13
















Android is perfectly capable of using jar files. The only reason to need AARs is if you have resources to include.

– Gabe Sechan
Mar 23 at 0:13





Android is perfectly capable of using jar files. The only reason to need AARs is if you have resources to include.

– Gabe Sechan
Mar 23 at 0:13












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309189%2fhow-can-i-generate-both-android-and-pure-java-libraries-from-a-single-code-base%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309189%2fhow-can-i-generate-both-android-and-pure-java-libraries-from-a-single-code-base%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript