Sunday, 15 January 2012

java - Maven or Gradle build types/variants -


Adds support for Android Grade plugin build types and build variants, so you can select your app The application wants to create a build step (eg debug or release).

This is a very useful feature for Gradal Projects, because you can get 2 versions of your application that can behave differently in some situations, or separate configuration files or properties build Based on the type of

Now, I have a question: Is there a similar feature / implementation for non-Android java projects from Maven or Gradle? I'm especially looking for Java web app, but I think that could be a big goal for this question too.

To bite it without following a vague answer, here Luke Delee (GradeWrite Engineer) There is an official response from on this matter:

This is something that we are actively working on. We are working to support the notion of variants in general, so that the domain has a consistent approach. This is a deep, deep change, though there is a lot to include.

You can expect to see aspects of rolling in grade 2.5 and above.

Edit later: I can finally work on the Java Webpage project using the source set instead of the build type; Variants Thinking that SourceSets have been around for a very long time, apparently you could have done this era before ... but even graduate engineers can explain how to do it properly ...

, check the build.gradle code below, where we use the same output directory for both sources, the location for the war plugin to rebuild Specify:

  Apply plugin: 'war' sourceSets {Main {output.resourcesDir = 'build / resources' output.classesDir = 'build / classes'} debug {Java {compileClasspath + = main.output runtimeClasspath + = main.output} output.resourcesDir = 'Build / resources' output. ClassesDir = 'build / classes'}} Collect tasks from DebugWar (Type: War) {SourceSets.debug.output archiveName "root.war"} ReeleaseWar (Type: War) {sourceSets.main. Output collection name "root.world"}  

No comments:

Post a Comment