plugins { id 'java' id 'application' id 'org.openjfx.javafxplugin' version '0.1.0' } group = 'org.example' version = '1.0.0' description = 'ClickMaster - Advanced Auto Clicker Application' java { sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21 // Classpath-based build - Module system devre dışı modularity.inferModulePath = false } // Repository tanımlamaları settings.gradle dosyasında yapıldı dependencies { // JNativeHook - Native keyboard/mouse hook için implementation 'com.1stleg:jnativehook:2.1.0' // Logging için implementation 'ch.qos.logback:logback-classic:1.4.14' implementation 'ch.qos.logback:logback-core:1.4.14' implementation 'org.slf4j:slf4j-api:2.0.9' // JSON işlemleri için implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3' implementation 'com.fasterxml.jackson.core:jackson-core:2.15.3' // Test bağımlılıkları testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.1' } application { mainClass = 'org.example.ClickMasterApp' applicationDefaultJvmArgs = [ '--add-opens=java.base/java.lang=ALL-UNNAMED', '--add-opens=java.base/java.util=ALL-UNNAMED', '--add-opens=java.base/java.io=ALL-UNNAMED', '--add-opens=java.desktop/java.awt=ALL-UNNAMED', '--add-opens=java.desktop/java.awt.event=ALL-UNNAMED', '--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED', '--add-modules', 'javafx.controls,javafx.fxml,javafx.graphics,javafx.base' ] } javafx { version = '21.0.2' modules = ['javafx.controls', 'javafx.fxml', 'javafx.graphics', 'javafx.base'] } test { useJUnitPlatform() testLogging { events "passed", "skipped", "failed" } } // JPackage konfigürasyonu - Console ile JavaFX dahil task createInstaller(type: Exec) { dependsOn jar // Windows için MSI oluşturma if (System.properties['os.name'].toLowerCase().contains('windows')) { commandLine 'jpackage', '--input', "${buildDir}/libs", '--name', 'ClickMaster', '--main-jar', "ClickMaster-${project.version}.jar", '--main-class', 'org.example.ClickMasterApp', '--type', 'msi', '--win-menu', '--win-menu-group', 'ClickMaster', '--win-dir-chooser', '--win-per-user-install', '--win-shortcut', '--win-shortcut-prompt', '--win-upgrade-uuid', '18159995-d967-4CD2-8885-77BFA97CFA9F', '--win-console', '--dest', "${buildDir}/distributions", '--module-path', 'C:\\javafx-sdk-21.0.8\\lib', '--add-modules', 'javafx.controls,javafx.fxml,javafx.graphics,javafx.base' } } // Kaynak kod karakter kodlaması tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } // JAR dosyası oluşturma - Basit Fat JAR jar { manifest { attributes( 'Main-Class': 'org.example.ClickMasterApp', 'Implementation-Title': 'ClickMaster', 'Implementation-Version': project.version, 'Implementation-Vendor': 'ClickMaster Team' ) } // Tüm bağımlılıkları dahil etme from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } duplicatesStrategy = DuplicatesStrategy.EXCLUDE } // Clean task'ı genişletme clean { delete fileTree(dir: 'build', include: '**/*') delete fileTree(dir: 'dist', include: '**/*') } // IntelliJ IDEA için özel run task'ı task runIntelliJ(type: JavaExec) { dependsOn classes mainClass = 'org.example.ClickMasterApp' classpath = sourceSets.main.runtimeClasspath jvmArgs = [ '--add-opens=java.base/java.lang=ALL-UNNAMED', '--add-opens=java.base/java.util=ALL-UNNAMED', '--add-opens=java.base/java.io=ALL-UNNAMED', '--add-opens=java.desktop/java.awt=ALL-UNNAMED', '--add-opens=java.desktop/java.awt.event=ALL-UNNAMED', '--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED', '--add-modules', 'javafx.controls,javafx.fxml,javafx.graphics,javafx.base' ] } // Gradle wrapper güncelleme wrapper { gradleVersion = '8.5' distributionType = Wrapper.DistributionType.BIN }