plugins { id 'java' // Apply the application plugin to add support for building a Java application id 'application' } // Define the main class for the application mainClassName = 'com.ra4king.circuitsim.gui.CircuitSimRunner' group 'CircuitSim' ext.moduleName = 'Project.com.ra4king.circuitsim.gui' sourceCompatibility = JavaVersion.VERSION_14 // In this section you declare where to find the dependencies of your project repositories { // Use mavenCentral for resolving dependencies mavenCentral() } dependencies { implementation 'com.google.code.gson:gson:2.10' implementation "org.openjfx:javafx-base:19:win" implementation "org.openjfx:javafx-base:19:linux" implementation "org.openjfx:javafx-base:19:mac" implementation "org.openjfx:javafx-controls:19:win" implementation "org.openjfx:javafx-controls:19:linux" implementation "org.openjfx:javafx-controls:19:mac" implementation "org.openjfx:javafx-graphics:19:win" implementation "org.openjfx:javafx-graphics:19:linux" implementation "org.openjfx:javafx-graphics:19:mac" implementation "org.openjfx:javafx-swing:19:win" implementation "org.openjfx:javafx-swing:19:linux" implementation "org.openjfx:javafx-swing:19:mac" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0' testImplementation 'org.mockito:mockito-core:4.11.0' testImplementation 'com.google.truth:truth:1.1.3' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0' } test { useJUnitPlatform() } jar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE into 'resources', { from 'resources' } inputs.property("moduleName", moduleName) manifest { attributes( 'Automatic-Module-Name': moduleName, 'Main-Class': mainClassName ) } from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } } compileJava { inputs.property("moduleName", moduleName) doFirst { options.compilerArgs = [ '--module-path', classpath.asPath, '--add-modules', 'javafx.controls,javafx.swing', '-Xlint:unchecked' ] classpath = files() } } task createJar(type: Copy) { dependsOn 'jar' into "$buildDir/libs" from configurations.runtimeClasspath }