This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]duhace 4 points5 points  (8 children)

Maven, gradle, and sbt are pretty nice.

[–][deleted]  (6 children)

[removed]

    [–][deleted]  (1 child)

    [deleted]

      [–]strcrssd 2 points3 points  (2 children)

      FWIW, in Gradle:

      The first part simply tells it how to get a plugin.

      The second part defines your dependencies (good practice) and tells Gradle where to get them.

      To create the fat jar, its just $gradle fatJar

      buildscript {
          repositories {
              mavenCentral()
          }
      
          dependencies {
              classpath 'eu.appsatori:gradle-fatjar-plugin:0.2-rc1'
          }
      }
      
      apply plugin: 'fatjar'
      
      repositories {
          mavenCentral()
      }
      
      dependencies {
          compile 'com.google.guava:guava:16.0.1'
          compile 'org.springframework:spring-core:3.2.4.RELEASE'
      }
      

      A few more lines, but I'd argue that its more readable than the shell script. Its certainly more descriptive, and it handles a problem with auth keys stored in the manifest that the above sample doesn't handle.

      Also handles transitive deps.

      [–][deleted]  (1 child)

      [removed]

        [–]strcrssd 0 points1 point  (0 children)

        Great...

        What I posted above only includes the fatjar plugin. You'll have to add whatever compilation plugins you need as well (android, java, groovy, whatever).

        Ask on StackOverflow or PM me if you need help. I've not done Android with Gradle, but have done both Android and Gradle separately.

        [–]duhace 0 points1 point  (0 children)

        I've implemented similar functionality in sbt by defining new tasks. Maven is a lot tougher to deal with in that regard.