description = "Provides support for simple CRUD applications built on top of Tapestry and JPA"

dependencies {
  implementation project(':tapestry-core')
  api 'jakarta.persistence:jakarta.persistence-api:3.0.0'
  implementation 'jakarta.enterprise:jakarta.enterprise.cdi-api:3.0.1'

  testImplementation 'org.slf4j:slf4j-simple:1.7.25'
  testImplementation 'org.slf4j:slf4j-simple:2.0.5'
  testImplementation project(':tapestry-test')
  testImplementation 'org.eclipse.persistence:eclipselink:3.0.4'

  testRuntimeOnly "org.apache.tomcat:dbcp:6.0.32"
  testRuntimeOnly 'com.h2database:h2:1.3.175'
  
}

repositories {
    maven {
        name "EclipseLink"
        url "https://download.eclipse.org/rt/eclipselink/maven.repo/"
    }
}

test {
    systemProperties "tapestry.service-reloading-enabled": "false"
}


jar {
    manifest {
        attributes 'Tapestry-Module-Classes': 'org.apache.tapestry5.jpa.modules.JpaModule'
    }
}

task runTestApp1(type:JavaExec) {
    description 'Start app1 integration test app, useful when debugging failing integration tests'
    main = 'org.apache.tapestry5.test.JettyRunner'
    args "-d", "src/test/app1", "-p", "8080"
    classpath += project.sourceSets.test.runtimeClasspath
}

task runTestApp2(type:JavaExec) {
    description 'Start app2 integration test app, useful when debugging failing integration tests'
    main = 'org.apache.tapestry5.test.JettyRunner'
    args "-d", "src/test/app2", "-p", "8080"
    classpath += project.sourceSets.test.runtimeClasspath
}

task runTestApp3(type:JavaExec) {
    description 'Start app3 integration test app, useful when debugging failing integration tests'
    main = 'org.apache.tapestry5.test.JettyRunner'
    args "-d", "src/test/app3", "-p", "8080"
    classpath += project.sourceSets.test.runtimeClasspath
}

task runTestApp4(type:JavaExec) {
    description 'Start app4 integration test app, useful when debugging failing integration tests'
    main = 'org.apache.tapestry5.test.JettyRunner'
    args "-d", "src/test/app4", "-p", "8080"
    classpath += project.sourceSets.test.runtimeClasspath
}

task runTestApp5(type:JavaExec) {
    description 'Start app5 integration test app, useful when debugging failing integration tests'
    main = 'org.apache.tapestry5.test.JettyRunner'
    args "-d", "src/test/app5", "-p", "8080"
    classpath += project.sourceSets.test.runtimeClasspath
}

task runTestApp6(type:JavaExec) {
    description 'Start app6 integration test app, useful when debugging failing integration tests'
    main = 'org.apache.tapestry5.test.JettyRunner'
    args "-d", "src/test/app6", "-p", "8080"
    classpath += project.sourceSets.test.runtimeClasspath
}