Skip to content

Commit

Permalink
Moved mac extension flag to top level Gradle script
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamCarroll committed Nov 6, 2017
1 parent 5b01a87 commit 2b5475f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
7 changes: 7 additions & 0 deletions build.gradle
Expand Up @@ -2,6 +2,13 @@
* Open Source Software published under the Apache Licence, Version 2.0.
*/

import org.gradle.internal.os.OperatingSystem

ext {
operatingSystem = OperatingSystem.current()
isIncludeMacExtensions = operatingSystem.isMacOsX()
}

allprojects {
group 'io.github.vocabhunter'
}
Expand Down
4 changes: 1 addition & 3 deletions osx/build.gradle
Expand Up @@ -2,9 +2,7 @@
* Open Source Software published under the Apache Licence, Version 2.0.
*/

import org.gradle.internal.os.OperatingSystem

if (OperatingSystem.current().isMacOsX()) {
if (isIncludeMacExtensions) {
sourceSets {
main {
java {
Expand Down
11 changes: 5 additions & 6 deletions package/build.gradle
Expand Up @@ -2,8 +2,6 @@
* Open Source Software published under the Apache Licence, Version 2.0.
*/

import org.gradle.internal.os.OperatingSystem

buildscript {
repositories {
jcenter()
Expand All @@ -19,10 +17,11 @@ apply plugin: 'javafx-gradle-plugin'
ext {
publishedVersion = project.version
bundleMainClass = 'io.github.vocabhunter.gui.distribution.PackagedVocabHunter'
operatingSystem = OperatingSystem.current()
if (operatingSystem.isMacOsX()) {
packageType = 'dmg'
bundleMainClass = 'io.github.vocabhunter.osx.distribution.OsxPackagedVocabHunter'
if (isIncludeMacExtensions) {
bundleMainClass = 'io.github.vocabhunter.osx.distribution.OsxPackagedVocabHunter'
}
appIcon = file('icons/mac/VocabHunter.icns')
sessionIcon = file('icons/mac/VocabHunterSession.icns')
} else if (operatingSystem.isLinux()) {
Expand All @@ -41,12 +40,12 @@ ext {

dependencies {
compile project(':gui')
if (OperatingSystem.current().isMacOsX()) {
if (isIncludeMacExtensions) {
compile project(':osx')
}
}

if (operatingSystem.isMacOsX()) {
if (isIncludeMacExtensions) {
sourceSets {
main {
java {
Expand Down

0 comments on commit 2b5475f

Please sign in to comment.