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

Usage with Kotlin DSL #15

Open
utybo opened this issue Aug 4, 2019 · 1 comment
Open

Usage with Kotlin DSL #15

utybo opened this issue Aug 4, 2019 · 1 comment

Comments

@utybo
Copy link

utybo commented Aug 4, 2019

How can I configure this plugin using the Kotlin DSL? using configure<Exe> does not work.

@Harleyoc1
Copy link
Contributor

Harleyoc1 commented Jul 11, 2021

You can use it much in the same way as the Groovy configurations by using the declarative plugins block:

build.gradle.kts

plugins {
    id("java")
    id("application")
    id("org.mini2Dx.parcl") version "1.7.1"
}

parcl {
    exe {
        exeName = "myapplication"
    }

    app {
        appName = "My Application"
        icon = "relative/path/to/icon.icns"
        applicationCategory = "public.app-category.adventure-games"
        displayName = "My Application"
        identifier = "com.example.my.apple.identifier"
        copyright = "Copyright 2015 Your Name Here"
    }

    linux {
        binName = "myapplication"
    }
}

However, some extra setup is required since otherwise gradle infers the name as org.mini2Dx.parcl.gradle.plugin. This can be done by adding a resolution strategy in settings.gradle.kts, such as below:

settings.gradle.kts

pluginManagement {
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
    resolutionStrategy {
        eachPlugin {
            if (requested.id.namespace == "org.mini2Dx") {
                useModule("org.mini2Dx:parcl:" + requested.version)
            }
        }
    }
}

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

2 participants