TheBoegl / gradle-launch4j

A gradle-plugin to create windows executables with launch4j

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xmlConfigName doesnot seem to work

msuperdev opened this issue · comments

xmlConfigName does not work with either the launch4j plugin config or the External task. Is anyone trying to use the xml config and may be override some of the attributes with the plugin?

What exactly are you trying to do?
What happens in comparison to your expected behavior?

I think I figured out what the issue is.

First and foremost, there has been a code change between the version I have (2.3.0) and the develop branch. Second, the xml config is always regenerated no matter what, this is a problem. Tell me if there is a way to tell not to re-create the xml. I could be wrong here

I really like to help you but I need more information to do that:

  1. What version of this plugin are you using?
  2. Which code change are you referring to?
    There are a few changes but the only likely one is fa632f8. That did not change the internal handling of the 'per task xml file', but it is not responsible for not using your xml file.
  3. Could you post a simplified example of your current project/issue?

After rereading your issue again (and again): Do you want to patch an existing launch4j xml file?
Neither it is possible with this implementation nor I'm planning to implement it.

I was trying to use a launch4j.xml with no classpath values. But everytime I ended up with libs in the build directory. With the debug parameter -Pl4j-debug, I could tell that the xml is generated everytime, even if the only property is xmlFileName. I will try to post a real example since you ask..

XML

  <classPath>
    <mainClass>com.pkg.app.App</mainClass>
    <cp>build/libs/l4jplugintest.jar</cp>
  </classPath>

Build

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'edu.sc.seis.launch4j'

buildscript {
  repositories {
	jcenter()
  }
  dependencies {
	classpath 'edu.sc.seis.gradle:launch4j:2.3.0'
  }
}

repositories {
    jcenter()
}

dependencies {
    compile 'com.google.guava:guava:20.0'
    testCompile 'junit:junit:4.12'
}

launch4j {
  xmlFileName = "launch4j.xml"
}

This plugin uses the gradle style convention over configuration, hence, it configures many things for you. Take a look at the documentation for the default values.

I don't get why you want to use the almost empty but incorrect xml file, when this plugin already "wires" its content correctly.

I am trying to generate the exe with a custom classpath (dependent jars exploded in various locations at runtime), and so do not want the plugin to modify this. The classpath also could not be configured in 2.3.0 through plugin configuration unlike you mentioned in the documentation.

Appreciate your help!

The documentation I linked to is for the current snapshot version 2.4.0-1-SNAPSHOT. The classpath property was added after 2.3.0. Please try to use the snapshot version.

I could help you better if you give me more insight into your code base.

That's all the information I have. Just try to run createExe with no <cp> in classpath (no jars) for the xml. Just see what happens in build/launch4j/lib and build/tmp/createExe/launchj.xml

By the way, would this be enough

buildscript {
   repositories {
     jcenter()
   }
  dependencies {
     classpath 'gradle.plugin.edu.sc.seis.gradle:launch4j:2.4.0-1-SNAPSHOT'
   }
}

Take a look at the documentation.

Running createExe on the following build.gradle should result in your desired output, though IMHO your classpath is wrong:

buildscript {
  repositories {
    jcenter()
    maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local/" }
  }
  dependencies {
    classpath 'edu.sc.seis.gradle:launch4j:2.4.0-1-SNAPSHOT'
  }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'edu.sc.seis.launch4j'

repositories {
    jcenter()
}

dependencies {
    compile 'com.google.guava:guava:20.0'
    testCompile 'junit:junit:4.12'
}

launch4j {
  mainClassName = 'com.pkg.app.App'
  classpath = ['build/libs/l4jplugintest.jar']
}

@msuperdev please take a look on the supported markup here. I've fixed your markdown issues to at least read your source code...

Thanks for help. This can be closed now