Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for configurations.compile.collect not exists. #2

Open
MairwunNx opened this issue Feb 24, 2019 · 1 comment
Open

Example for configurations.compile.collect not exists. #2

MairwunNx opened this issue Feb 24, 2019 · 1 comment

Comments

@MairwunNx
Copy link

MairwunNx commented Feb 24, 2019

Gradle Script:

jar {
    from(configurations.compile.collect { entry -> zipTree(entry) }) {
        exclude "META-INF/MANIFEST.MF"
        exclude "META-INF/*.SF"
        exclude "META-INF/*.DSA"
        exclude "META-INF/*.RSA"
    }
}

Kotlin DSL Script: [not work]

val jar: Jar by tasks

jar.apply {
    from(configurations.compile.fileCollection().forEach {
        zipTree(it)
    })
}

Compile log:

BUILD FAILED in 0s
4 actionable tasks: 1 executed, 3 up-to-date
Cannot convert the provided notation to a File or URI: kotlin.Unit.
The following types/formats are supported:
  - A String or CharSequence path, for example 'src/main/java' or '/usr/include'.
  - A String or CharSequence URI, for example 'file:/usr/include'.
  - A File instance.
  - A Path instance.
  - A Directory instance.
  - A RegularFile instance.
  - A URI or URL instance.
@MairwunNx
Copy link
Author

Problem easy solve by Shadow plugin, but i think it can be solved by just kotlin DSL script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant