
description = "Lambda API"

sourceSets {
    integration {
        java.srcDir "$projectDir/src/integration/java"
        resources.srcDir "$projectDir/src/integration/resources"
        compileClasspath += main.output + test.output
        runtimeClasspath += main.output + test.output
    }
}

configurations {
    integrationImplementation.extendsFrom testImplementation
    integrationRuntime.extendsFrom testRuntime
}

tasks.processIntegrationResources {
    duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

dependencies {

	annotationProcessor group: 'com.formkiq', name: 'graalvm-annotations-processor', version: '1.4.2'

	api project(':strings')
	api project(':document-events')
	api project(':fkq-lambda-services')
	api project(':fkq-lambda-core')
	api project(':fkq-validation')
	api project(':fkq-plugins')
	api project(':aws-s3')
	api project(':aws-cognito-identityprovider')
	api project(':aws-sqs')
	api project(':aws-ssm')
	api project(':aws-sns')
	api project(':aws-ses')
	api project(':aws-dynamodb')
	api project(':dynamodb-documents')
	api project(':actions')
	api project(':typesense')
	api project(':ocr')
	api project(':http-sigv4')
	
	api group: 'com.amazonaws', name: 'aws-lambda-java-core', version: '1.2.3'
    api group: 'com.google.code.gson', name: 'gson', version: '2.13.0'
    
    api group: 'com.formkiq', name: 'lambda-runtime-graalvm', version:'2.5.0'
    api group: 'com.formkiq', name: 'graalvm-annotations', version: '1.2.0'
    
	api group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.17'
	
    testImplementation project(':aws-cognito-identity')
    testImplementation project(':aws-cognito-identityprovider')
	testImplementation project(':aws-iam')
	testImplementation project(':aws-sts')
	testImplementation project(':fkq-test-utils')
	testImplementation project(':lambda-typesense')
	
	testImplementation group: 'software.amazon.awssdk', name: 'apigateway', version: '2.31.25'
	testImplementation group: 'software.amazon.awssdk', name: 'sts', version: '2.31.25'

	testImplementation group: 'commons-codec', name: 'commons-codec', version: '1.18.0'
    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version:'5.11.4'
    testImplementation group: 'org.testcontainers', name: 'testcontainers', version: '1.20.6'
	testImplementation group: 'org.testcontainers', name: 'junit-jupiter', version: '1.20.6'
	testImplementation group: 'org.testcontainers', name: 'localstack', version: '1.20.6'
	testImplementation group: 'org.mock-server', name: 'mockserver-netty', version: '5.15.0'
}

compileJava {
    options.annotationProcessorPath += configurations.runtimeClasspath
}

test {
  failFast = true
  useJUnitPlatform()
  maxHeapSize = '1G'
}

task integrationTest(type: Test) {
    testClassesDirs = sourceSets.integration.output.classesDirs
    classpath = sourceSets.integration.runtimeClasspath
    useJUnitPlatform()
}

task buildJava11Zip(type: Zip) {
    from compileJava
    into('lib') {
        from configurations.default
    }           
}

buildJava11Zip.dependsOn jar
