/*
 * Copyright 2019 Esri
 *
 * 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.
 */

ext {
    _versionCode = 117
    _versionName = "100.15.0"
    _fullVersion = getFullVersion() // e.g. 100.9.0-1234
    _groupId = "com.esri.arcgisruntime"
    _artifactId = 'arcgis-android-toolkit'
}

// Returns the full version number, including the build number, for example 100.9.0-1234 by looking
// for the build number defined by one of the following options:
// - BUILDNUM property passed through command line
// - BUILDNUM property read from GRADLE_HOME/gradle.properties or local gradle.properties
// - BUILDNUM set as system environment variable
String getFullVersion() {
    def buildNumber = "1"
    if (project.hasProperty("BUILDNUM")) {
        buildNumber = project.findProperty("BUILDNUM") ?: "1"
    } else {
        buildNumber = System.getenv("BUILDNUM") ?: "1"
    }
    return _versionName + "-" + buildNumber
}
