build.gradle 4.07 KB
Newer Older
PWF-WK01\pengwufeng committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
buildscript {
	if ("jcenter".equals(mavenRepo)) {
		repositories {
			jcenter()
		}
	} else if ("mavenCentral".equals(mavenRepo)) {
		repositories {
			mavenCentral()
		}
	} else if ("ali".equals(mavenRepo)) {
		repositories {
			maven {
				url aliRepoUrl
			}
		}
	} else if ("local".equals(mavenRepo)) {
		repositories {
			maven {
PWF-WK01\pengwufeng committed
19 20 21 22 23
				credentials {
					username getUsername
					password getPassword
				}
				url mavenPluginRepoUrl
PWF-WK01\pengwufeng committed
24 25 26 27 28 29
			}
		}
		configurations.all {
			resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
		}
		dependencies {
PWF-WK01\pengwufeng committed
30
			classpath "com.beecode:mk-gradle-plugin:1.1.0"
PWF-WK01\pengwufeng committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
		}
	} else {
		// default
		repositories {
			jcenter()
		}
	}
	dependencies {
		classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.2.RELEASE")
		
	}
}
// plugins {
//   id "com.gorylenko.gradle-git-properties" version "1.5.1"
// }

// gitProperties {
//     dateFormat = "yyyy-MM-dd'T'HH:mmZ"
//     dateFormatTimeZone = "GMT+8"
// }
ext {
	inzVersion               = "1.0.+"
	ueditorVersion			 = "1.0.+"
}

apply from: "../common.gradle"
apply plugin: 'org.springframework.boot'
apply plugin: 'war'
apply plugin: 'eclipse'

war {
	baseName = 'inz'
}

repositories {
	if ("jcenter".equals(mavenRepo)) {
		jcenter()
	} else if ("mavenCentral".equals(mavenRepo)) {
		mavenCentral()
	} else if ("ali".equals(mavenRepo)) {
		maven {
			url aliRepoUrl
		}
	} else if ("local".equals(mavenRepo)) {
		maven {
PWF-WK01\pengwufeng committed
76 77 78 79
			credentials {
				username getUsername
				password getPassword
			}
PWF-WK01\pengwufeng committed
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
			url mavenRepoUrl
		}
		maven {
			url aliRepoUrl
		}
	} else {
		// default
		jcenter()
	}
}

dependencies {
	compile lib.spring_boot_starter_web
	
	compile lib.thymeleaf_extras
	compile lib.spring_security_core
	compile lib.spring_security_config
	compile lib.spring_security_web
	compile lib.hibernate_core
	compile lib.hikari
	compile lib.mysql_connector

	compile lib.spring_boot_starter_data_redis
	compile "org.springframework.boot:spring-boot-starter-json:${springBootVersion}"
	compile "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"
	compile lib.spring_boot_starter_jdbc
	compile lib.spring_boot_starter_security
	compile lib.spring_boot_starter_web_service
	compile lib.spring_session_core
	compile lib.spring_session_redis
	compile lib.liquibase
	compile lib.cxf_rt_frontend_jaxws
	compile lib.cxf_rt_transports_http
	compile lib.amino_boot
	compile lib.amino_boot_web
	compile lib.amino_shell
	compile lib.amino_tenant
	compile lib.amino_tenant_liquibase
	
	compile lib.bap2_attachment
	compile lib.bap2_core
	compile lib.bap2_sysconfig
	compile lib.bap2_system
	compile lib.hibernate_common_annotations
airyuxun committed
124
	compile lib.net_byte_buddy
PWF-WK01\pengwufeng committed
125 126 127 128 129 130 131 132 133 134 135 136
	compile lib.bcp_authc
	compile lib.bcp_import
	compile lib.json
	compile "com.beecode:inz.authmgr:${inzVersion}"
	compile "com.beecode:inz.common:${inzVersion}"
	compile "com.beecode:inz.query:${inzVersion}"
	compile "com.beecode:inz.basis:${inzVersion}"
	compile "com.beecode:inz.init.data:${inzVersion}"
	compile "com.beecode:inz.authentication:${inzVersion}"
	compile "com.beecode:inz.workflow:${inzVersion}"
	compile "com.beecode:inz.message:${inzVersion}"
	compile "com.beecode:inz.enterprisesetting:${inzVersion}"
137
	compile "com.beecode:xyst.dinas.oa:${inzVersion}"
杨清松 committed
138
	compile "com.beecode:xyst.dinas.biz:${inzVersion}"
杨清松 committed
139
	compile "com.beecode:xyst.dinas.project:${inzVersion}"
140
	compile "com.beecode:xyst.dinas.production:${inzVersion}"
王衍超 committed
141
	compile "com.beecode:xyst.dinas.contract:${inzVersion}"
142
	compile "com.beecode:xyst.dinas.camera:${inzVersion}"
PWF-WK01\pengwufeng committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
	providedRuntime lib.spring_boot_starter_tomcat
}

def projName = name
def projVersion = version
def warPath = war.archivePath.absolutePath
task generateResultInfo() {
	if (outFile != null && !outFile.isEmpty()) {
		doLast {
			def builder = new groovy.xml.StreamingMarkupBuilder()
			builder.encoding = 'UTF-8'
			def resultInfo = {
				mkp.xmlDeclaration()
				it.build {
					it.project(name: projName, version: projVersion) {
						it.artifact(path: warPath)
					}
				}
			}
			def writer = new FileWriter(outFile)
			try {
				writer << builder.bind(resultInfo)
			} finally {
				writer.close()
			}
		}
	}
}
build.dependsOn 'generateResultInfo'