/*
 * This file was generated by the Gradle 'init' task.
 *
 * This is a general purpose Gradle build.
 * Learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.14.3/samples
 * This project uses @Incubating APIs which are subject to change.
 */

plugins {
  id 'java'
  id 'application' 
}

// Apply a specific Java toolchain to ease working on different environments.
java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(24)
    }
}

application {
    mainClass = 'lodge.TestReservations'
    applicationDefaultJvmArgs = ["--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED"]
}

sourceSets {
  main {
    java { 
      srcDirs = ['src/main/java']
    }
  }
  test {
    java { 
      srcDirs = ['src/test/java']
    }
    runtimeClasspath = files("$projectDir/libs/*.jars")
  }
}

repositories {
  mavenCentral()
  fileTree(dir:'libs', include:'*.jar')
}

dependencies {

  //https://mvnrepository.com/artifact/com.google.code.gson/gson
  implementation 'com.google.code.gson:gson:2.13.2'
}

jar {
  manifest {
    attributes 'Main-Class': application.mainClass 
  }
}

tasks.named('jar') {
    manifest {
        attributes('Implementation-Title': 'lodge.reservationsystem',
                   'Implementation-Version': 1.0,
                   'Main-Class': 'lodge.TestReservations',
                   'Class-Path': 'lodge.reservationsystem com.google.gson .' )
    }
}
