// Apply the publishing plugin
buildscript {
    repositories {
        jcenter()
        gradlePluginPortal()
    }
    dependencies {
        classpath 'com.gradle.publish:plugin-publish-plugin:0.12.0'
    }
}

apply plugin: 'com.gradle.plugin-publish'
apply plugin: 'groovy'
apply plugin: 'java-gradle-plugin'
apply plugin: 'maven'
apply plugin: 'maven-publish'

sourceCompatibility = '1.6'
targetCompatibility = '1.6'

version = '0.4.14' // <-----UPDATE THIS VERSION NUMBER MANUALLY FOR EACH RELEASE
group = 'com.gladed.androidgitversion'

repositories {
    jcenter()
}

dependencies {
    compile gradleApi()
    compile localGroovy()
    compile 'org.eclipse.jgit:org.eclipse.jgit:5.9.0.202009080501-r'
    testCompile "junit:junit:4.12"
}

test {
    reports {
        junitXml.enabled = true
        html.enabled = true
    }
}

gradlePlugin {
    plugins {
        androidGitVersion {
            id = project.group
            implementationClass = 'com.gladed.androidgitversion.AndroidGitVersion'
        }
    }
}

pluginBundle {
    website = 'https://github.com/gladed/gradle-android-git-version'
    vcsUrl = 'https://github.com/gladed/gradle-android-git-version'
    description = 'Automatically extract Android-friendly version names and codes from git tags'
    tags = [ 'android', 'git', 'version' ]
    plugins {
        androidGitVersion {
            displayName = 'Android Git Version plugin'
        }
    }
}
