buildscript {
	repositories {
		maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
		mavenLocal()
		mavenCentral()
	}
}
apply from:"./config.gradle"
apply plugin: 'java'
apply plugin: 'eclipse'

sourceCompatibility=1.8
group = 'kd.bos.service'
version = '1.0'
tasks.withType(JavaCompile) {
	options.encoding = "UTF-8"
}

def cus= ext.path.cus
def trd= ext.path.trd
def bos= ext.path.bos
def outputdir=  ext.path.outputdir
def currentapp=  ext.path.currentapp
def biz= ext.path.biz

dependencies {
	implementation fileTree(dir: bos, include: '**/*.jar')
	implementation fileTree(dir: trd, include: '**/*.jar')
	implementation fileTree(dir: biz, include: '**/*.jar')
	implementation fileTree(dir: cus, include: '**/*.jar')


}

task sourcesJar(type: Jar, dependsOn: build) {
	archiveClassifier = 'sources'
	from sourceSets.main.allSource
}

task copytolib(type: Copy,dependsOn: build){
	group 'build'
	description '拷贝本工程构建jar包到lib'
	from 'build/libs'
	into outputdir
	exclude '*source*.jar'
}
task copytorootlib(type: Copy){
	group 'build'
	description '拷贝本工程构建jar包到根目录build/libs'
	from 'build/libs'
	into '../build/libs'
	exclude '*source*.jar'
}

task copyJarTodir(type: Copy){
	group 'build'
	description  '拷贝工程产生的build.jar到本地库'
	from 'build/libs'
	into cus
	exclude '**/*.class'
}

/**
 * 执行zip打包操作
 */
task zip(type: Zip, dependsOn: jar) {
	group 'build'
	description  '将jar打包成zip'
	from 'build/libs'
	destinationDirectory = file('build/zip')
}

task copyZipTodir(type: Copy){
	group 'build'
	description  '拷贝工程产生的build.zip到本地库'
	from 'build/zip'
//	destinationDir file('build/zip')
	into '../build/zip'
}

test.ignoreFailures true

// 定义jar包manifest的信息，以便分析问题
jar {
	archiveBaseName = 'zlkj_hr_opmc'
	version = '1.0'
	manifest {
		attributes 'Builddate': new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
		attributes 'Release': ''
	}
}

// 定义zip包manifest的信息，以便分析问题
zip {
	archiveBaseName = 'zlkj_hr_opmc'
	version = '1.0'
	manifest {
		attributes 'Builddate': new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
		attributes 'Release': ''
	}
}
