/*
 * Copyright 2018 the original author or authors.
 *
 * 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.
 */

// tag::use-plugin[]
plugins {
    id 'application'
}
// end::use-plugin[]

version = '1.0.2'

// tag::applicationName-conf[]
applicationName = 'my-app'
// end::applicationName-conf[]

// tag::mainClassName-conf[]
application {
    mainClassName = 'org.gradle.sample.Main'
}
// end::mainClassName-conf[]

// tag::application-defaultjvmargs[]
application {
    applicationDefaultJvmArgs = ['-Dgreeting.language=en']
}
// end::application-defaultjvmargs[]

// tag::executableDir-conf[]
application {
    executableDir = 'custom_bin_dir'
}
// end::executableDir-conf[]

// tag::distribution-spec[]
task createDocs {
    def docs = file("$buildDir/docs")
    outputs.dir docs
    doLast {
        docs.mkdirs()
        new File(docs, 'readme.txt').write('Read me!')
    }
}

distributions {
    main {
        contents {
            from(createDocs) {
                into 'docs'
            }
        }
    }
}
// end::distribution-spec[]

repositories {
    mavenCentral()
}

dependencies {
    implementation 'commons-collections:commons-collections:3.2.2'
}
