Java in gradle task



  • I have to do a few things:

    1. Collect jar (may be done through dependency)
    2. Pass jar through ProGuard.
    3. "Fuck" my ProGuard jar'cu and all dependence on one folder. (plz help)
    4. Pick up md5 of all files, pack them in json and send them to servers with files from four points.

    For the last paragraph, I have a separate jar, when I start with the right parameters that I get everything I need. All I have to do is ask Gradle to do my jar with his parameters.
    How do you do that?

    PS how to implement 3 points?



  • Third paragraph: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Copy.html Permits these files to be copied in the right file:

    task initConfig(type: Copy) {
        from('proguard') {
            include '**/my.jar'
        }
        from('libs') {
            include '**/*.jar'
        }
        into 'target'
    }
    

    Launch jar: For jar launch, https://docs.gradle.org/current/dsl/org.gradle.api.tasks.JavaExec.html :

    task send_md5(type: JavaExec) {
      classpath = '/path/to/send_md5.jar'
      main = 'send_md5.Main'
      // параметры
      args 'tramparam'
    }
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2