plugins {
    id "application"
    id "java-library"
    id "maven-publish"
}
apply plugin : "java" 
ext {
   javaMainClass = "com.mycompany.app.Main"
}

application {
    mainClassName = javaMainClass
}

repositories {
    mavenLocal()
    maven {
        url = uri("https://repo.maven.apache.org/maven2/")
    }
}

dependencies {
    implementation "io.cdktn:cdktn:{{ cdktf_version }}"
    implementation "software.constructs:constructs:{{ constructs_version }}"
    testImplementation "junit:junit:4.13.2"
    testImplementation "org.junit.jupiter:junit-jupiter:5.8.0"
}

group = "com.mycompany.app"
version = "0.1"
description = "{{ $base }}"
java.sourceCompatibility = JavaVersion.VERSION_1_8



publishing {
    publications {
        maven(MavenPublication) {
            from(components.java)
        }
    }
}

tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}

tasks.withType(Javadoc) {
    options.encoding = "UTF-8"
}

test {
  useJUnit()
  useJUnitPlatform()
}
