GithubHelp home page GithubHelp logo

w8wjb / gradle-macappbundle-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cr0/gradle-macappbundle-plugin

0.0 0.0 0.0 210 KB

Fork of google code hosted gradle-macappbundle

Home Page: https://code.google.com/p/gradle-macappbundle/

Groovy 60.74% M 39.26%

gradle-macappbundle-plugin's Introduction

gradle-macappbundle-plugin Download

Create OS X application bundles from Java projects using gradle. A JVM can optionally be included.

It's not my work, though...

This is a fork of gradle-macappbundle by @crotwell. However, it differs in a few things:

  • Instead of providing two binary stubs (for Apple Java and Oracle Java) this version uses infinitekind's extended JavaAppLauncher which is available at bitbucket.
  • Now it's also possible to extend the classpath! Oracle's version did not allow altering the classpath, in fact it always used the default Java folder within an app bundle. Using the new JVMClassPath property in Info.plist the classpath can include either single jars or whole folders when the wildcard * is used. Of course, the contents of the (by default) Java folder within the bundle are also included.
  • Support for Apple Java has been removed since Apple stopped the development and recommends using Oracle's version.

How to use

First, you need to include the macappbundle plugin using the following fancy gradle 2.1+ syntax. The plugin is/should be available at jcenter.

plugins {
  id "com.github.cr0.macappbundle" version "3.0.1"
}

Please have a look at bintray for more details.

The following example shows a working configuration including the extendable classpath feature.

macAppBundle {
	appName = "Foo App"
	appCategory = "public.app-category.utilities"
	icon = "gradle/icon/fooapp.icns"
	agent = true

	version = "0.1.3-alpha+SNAPSHOT.123456789"
	shortVersion = "0.1.3a (nightly)"

	mainClassName = "org.foo.app.Launcher"

	bundleJRE = false
	bundleExecutable = "FooApp"
	bundleIdentifier = "org.foo.app"
	bundleCopyright = "Copyright 2015 Foo App"

	bundleExtras.put("NSHighResolutionCapable", "true")

	javaProperties.put("file.encoding", "utf-8")
	javaXProperties.add("mx2048M")
	javaXProperties.add("startOnFirstThread")

	javaClassPath.add("/Users/\$CURRENT_USER/.config/fooapp/plugins/*")

	archiveName = "Foo App ${pluginVersion}"
}

There are a few other options available -- if you're interested have a look at the source code.

If you use createApp, the plugin creates an app named Foo App.app in the build/macApp (settable using archiveOutputDir) directory.

You can also package the app as either a ZIP file (createAppZip) or a DMG with an optional background image (createDmg; applicable only on OS X).

A note on external cp's

As of 3.0.1, external class paths, i.e. all paths which are not in the app bundle, are optional. This is needed since many apps use external class path directories for e.g. plugins. Hence, such directories do not exist at first launch which caused a JavaDirectoryNotFound exception.

Licenses

Shoutouts to crotwell and infinitekind.

Where is 1.0.0 and 2.0.0?

Since this is a fork of crotwell's version which already was 2.0.0 I decided to bump the version again.

gradle-macappbundle-plugin's People

Contributors

cr0 avatar crotwell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.