0

I'm having a build.gradle file with both the gradle-clojure and the javafxports plugins. It compiles fine, but I do have one problem:

The compiled Clojure class files get placed under build/clojure/main. Since javafxports doesn't know that, I end up with an APK file that contains everything except the actual project class files.

How do I tell Gradle/JavaFXPorts to include these files when packaging?

This is my current build.gradle:

buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
        }
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.3.15'
    }
}

plugins {
  id 'gradle-clojure.clojure' version '0.4.0'
  id 'application'
  id 'com.github.johnrengelman.shadow' version '2.0.4'
  id 'maven-publish'
}

repositories {
    mavenCentral()
    maven {
        name = 'clojars'
        url = 'https://repo.clojars.org'
    }
}

dependencies {
    compile 'org.clojure:clojure:1.9.0'
    compile 'clojurefx:clojurefx:0.5.0-SNAPSHOT'

    testImplementation 'junit:junit:4.12'

    devImplementation 'org.clojure:tools.namespace:0.3.0-alpha4'
}

apply plugin: 'org.javafxports.jfxmobile'

group = 'lyrion'
version = '0.1.0-SNAPSHOT'

mainClassName = 'lyrion.cec'


clojure {
  builds {
    main {
      aotAll()
    }
  }
}

jfxmobile {
    javafxportsVersion = '8.60.9'
    downConfig {
        version = '3.8.5'
        plugins 'cache', 'device', 'lifecycle', 'orientation', 'settings', 'storage'
    }
    android {
        dexOptions {
            javaMaxHeapSize "4g"
        }

        packagingOptions {
            exclude 'project.clj'
        }

        applicationPackage = 'lyrion'
    }
}

publishing {
  publications {
    shadow(MavenPublication) { publication ->
      project.shadow.component(publication)
    }
  }
  repositories {
    maven {
      name = 'clojars'
      url = 'https://repo.clojars.org'
      credentials {
        username = System.env['CLOJARS_USER']
        password = System.env['CLOJARS_PASSWORD']
      }
    }
  }
}
Daniel Ziltener
  • 647
  • 1
  • 6
  • 21
  • 1
    I don't know why your classes are being added to `build/clojure/main`, according to this [answer](https://stackoverflow.com/a/34708362/3956070) all java/clojure/scala classes go to `build/classes/main`. Do you have a custom setting for the clojure sourceset? Can you post some code (at least your build file)? – José Pereda Oct 16 '18 at 22:20
  • Maybe this got changed since that answer was written? I updated my question with the build.gradle file. – Daniel Ziltener Oct 17 '18 at 08:54
  • I managed to get it to output the class files to `build/classes/main`, which makes no difference and still gets ignored by jfxmobile. – Daniel Ziltener Oct 18 '18 at 11:46

0 Answers0