buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
        jcenter()
    }
}

plugins {
  id "com.jfrog.bintray" version "1.8.4"
  id "maven-publish"
  id "java-library"
}

repositories {
  mavenLocal()
  mavenCentral()
  jcenter()
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar']) // DO NOT CHANGE, CI may needs it when packaging
    implementation "commons-codec:commons-codec:1.11"
    implementation "junit:junit:4.12"
}

jar.baseName = 'authentication'
version = '1.6.1'

task sourcesJar(type: Jar, dependsOn: classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives sourcesJar
    archives javadocJar
}

bintray {
	user = System.getProperty('bintray.user')
	key = System.getProperty('bintray.key')

	pkg {
		repo = 'maven'
		name = 'authentication'
		userOrg = 'agora'
		licenses = ['Apache-2.0']
		vcsUrl = 'https://github.com/AgoraIO/Tools.git'
		version {
			name = '1.6.1'
			desc = 'Agora’s Authentication Mechanisms'
			released  = new Date()
		}
	}

}

