/*
 * Copyright (c) 2019, 2020 Oracle and/or its affiliates. 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.
 */

apply plugin: 'java'

ext {
   fdkVersion = '1.0.56'
}

repositories {
    mavenCentral()
    maven {
        url 'https://dl.bintray.com/fnproject/fnproject'
    }
}

dependencies {
    runtime "com.fnproject.fn:api:$fdkVersion"
    // runtime "com.fnproject.fn:runtime:$fdkVersion" // this is optional and included with its deps in the base image to reduce layer size

    testCompile "junit:junit:4.12"
    testCompile "com.fnproject.fn:testing:$fdkVersion"
}

task cacheDeps(type: Exec) {
    configurations.testRuntime.files
    commandLine 'echo', 'Downloaded all dependencies'
}

task copyDeps(type: Copy) {
  from configurations.compile
  into "${project.buildDir}/deps"
}

build.dependsOn copyDeps
