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

DMG and non-Java applications #93

Open
ocroquette opened this issue Aug 30, 2020 · 3 comments
Open

DMG and non-Java applications #93

ocroquette opened this issue Aug 30, 2020 · 3 comments

Comments

@ocroquette
Copy link

Hello,

I am using SetupBuild to package a non-Java application. MSI generation on Windows works well, but on macOS, I get the following error:

Build file '/Users/.../build.gradle' line: 147

* What went wrong:

Execution failed for task ':dmg'.

> A main class is required for the application. You have to configure at least the following:
        setupBuilder {
                [..]
                mainClass = 'your.org.main.class'
        }

    org.codehaus.groovy.control.ConfigurationException: A main class is required for the application. You have to configure at least the following:
        at com.inet.gradle.setup.dmg.AbstractOSXApplicationBuilder.prepareApplication(AbstractOSXApplicationBuilder.java:116)
        at com.inet.gradle.setup.dmg.OSXApplicationBuilder.buildApplication(OSXApplicationBuilder.java:89)
        at com.inet.gradle.setup.dmg.DmgBuilder.build(DmgBuilder.java:95)
        at com.inet.gradle.setup.dmg.Dmg.build(Dmg.java:108)
        at com.inet.gradle.setup.abstracts.AbstractTask.action(AbstractTask.java:101)

Is this use case unsupported?

@Horcrux7
Copy link
Member

Sounds like you have define a desktopStarter. Can you give more details.

@ocroquette
Copy link
Author

ocroquette commented Aug 30, 2020

That's correct. I disabled the desktopStarter now, but this leads to another error:

No Services or DesktopStarters have been defined. Will stop now

Here is a minimal script reproducing the issue:

plugins {
    id "de.inetsoftware.setupbuilder" version "3.4.7" // version depends on Gradle version
}
apply plugin: 'de.inetsoftware.setupbuilder'

def isWindows = System.properties['os.name'].toLowerCase().contains('windows')

setupBuilder {
    vendor = 'Vendor'
    application = "Application"
    appIdentifier = "appIdentifier"
    version = '1.0.0'
    destinationDir = "artifacts"
    from("mydir") {
        include '**'
    }
    if(isWindows) {
        desktopStarter {
            location = com.inet.gradle.setup.abstracts.DesktopStarter.Location.StartMenu
            executable = "tool.exe"
        }
    }
}

msi {
    languages = [ "en-US" ]
}

I am trying to generate a DMG file from the content of "mydir".

@gamma
Copy link
Member

gamma commented Aug 31, 2020

The setup builder does not currently allow generating DMG applications for non-java applications.

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

No branches or pull requests

3 participants