/*
 * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

plugins {
    id 'java'
    id "com.github.johnrengelman.shadow" version "7.1.0"
}

configurations {
    provided
    compile.extendsFrom provided
}

group = project.sfdc_trigger_group
version = project.sfdc_trigger_version

repositories {
    mavenLocal()

    maven {
        url = 'https://maven.wso2.org/nexus/content/groups/wso2-public/'
    }

    maven {
        url = 'https://repo.maven.apache.org/maven2'
    }

    maven {
        url = 'https://maven.pkg.github.com/ballerina-platform/ballerina-lang'
        credentials {
            username System.getenv("packageUser")
            password System.getenv("packagePAT")
        }
    }
}


dependencies {
    shadow group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.10.8'
    shadow group: 'org.cometd.java', name: 'cometd-java-client', version: '4.0.4'
    implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
    shadow group: 'org.json', name: 'json', version: '20210307'
    implementation group: 'org.ballerinalang', name: 'ballerina-lang', version: project.ballerinaLangVersion
    implementation(group: 'org.ballerinalang', name: 'ballerina-runtime', version: project.ballerinaLangVersion) {
        transitive = false
    }
    // testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    // testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

test {
//    useJUnitPlatform()
}

shadowJar {
    configurations = [project.configurations.shadow]
    dependencies {
        exclude(dependency('org.slf4j:.*:.*'))
    }
}

build.dependsOn(shadowJar)
