1 Star 0 Fork 50

tianbuaa / incubator-eventmesh

forked from WeBank / eventmesh 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 12.06 KB
一键复制 编辑 原始数据 按行查看 历史
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
import java.util.concurrent.TimeUnit
buildscript {
repositories {
maven {
url "https://maven.aliyun.com/repository/public"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.1"
classpath "io.spring.gradle:dependency-management-plugin:1.0.11.RELEASE"
classpath "com.github.jk1:gradle-license-report:1.17"
}
}
allprojects {
apply plugin: 'java'
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "project-reports"
apply plugin: "maven-publish"
apply plugin: "com.github.spotbugs"
apply plugin: "project-reports"
apply plugin: "jacoco"
apply plugin: "pmd"
apply plugin: "java-library"
apply plugin: 'signing'
apply plugin: 'com.github.jk1.dependency-license-report'
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
clean.doFirst {
delete 'build'
delete 'dist'
delete 'out'
}
if ((project.findProperty("snapshot") instanceof String) && (Boolean.valueOf(project.property("snapshot")))) {
version = version + "-SNAPSHOT"
}
licenseReport {
allowedLicensesFile = new File("build/license/allowed-licenses.json")
}
checkLicense.doFirst {
new File("build/license").mkdirs()
new File("build/license/allowed-licenses.json").createNewFile()
def writer = new File("build/license/allowed-licenses.json").newPrintWriter()
new File("tool/license/allowed-licenses.txt").filterLine {
String line -> line.trim().length() != 0 && !line.startsWith("#")
}.writeTo(writer)
writer.flush()
writer.close()
}
}
task tar(type: Tar) {
extension = 'tar.gz'
compression = Compression.GZIP
archiveFileName = project.name + '_' + project.version + '.' + extension
destinationDirectory = new File(projectDir, 'build')
into('/') {
from 'dist'
}
}
task zip(type: Zip) {
extension = 'zip'
archiveFileName = project.name + '.' + project.version + '.' + extension
destinationDirectory = new File(projectDir, 'build')
into('/') {
from 'dist'
}
}
subprojects {
apply plugin: "io.spring.dependency-management"
sourceSets {
main {
java.srcDirs = ['src/main/java']
}
test {
java.srcDirs = ['src/test/java']
}
}
clean.doFirst {
delete 'build'
delete 'dist'
}
jacoco {
toolVersion = "0.8.6"
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled false
}
}
spotbugs {
ignoreFailures = true
showProgress = true
showStackTraces = true
effort = 'default'
reportsDir = file("$buildDir/reports/spotbugs")
projectName = rootProject.name
release = version
extraArgs = ['-nested:false']
maxHeapSize = '256m'
}
spotbugsMain {
reports {
xml.enabled = false
html {
enabled = true
destination = file("$buildDir/reports/spotbugs/main/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
}
spotbugsTest {
reports {
xml.enabled = false
html {
enabled = true
destination = file("$buildDir/reports/spotbugs/test/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
}
pmd {
consoleOutput = true
toolVersion = "6.23.0"
rulesMinimumPriority = 5
ruleSets = ["category/java/errorprone.xml", "category/java/bestpractices.xml"]
ignoreFailures = true
}
jar {
manifest {
attributes("Specification-Version": project.version,
"Specification-Vendor": "WeBank, Inc.",
"Specification-Title": project.name,
"Implementation-Version": project.version,
"Implementation-Vendor": "WeBank, Inc.",
"Implementation-Title": project.name,
"Build-Jdk": project.findProperty("jdk")
)
}
}
task dist(dependsOn: ['jar']) {
doFirst {
new File(projectDir, '../dist/bin').mkdirs()
new File(projectDir, '../dist/apps').mkdirs()
new File(projectDir, '../dist/conf').mkdirs()
new File(projectDir, '../dist/lib').mkdirs()
}
doLast {
copy {
into('../dist/apps/')
from project.jar.getArchivePath()
exclude 'eventmesh-common*.jar'
exclude 'eventmesh-connector-api*.jar'
exclude 'eventmesh-connector-plugin*.jar'
exclude 'eventmesh-starter*.jar'
exclude 'eventmesh-test*.jar'
exclude 'eventmesh-sdk*.jar'
}
copy {
into '../dist/lib'
from project.configurations.runtimeClasspath
exclude '**/*.properties*'
exclude '**/*testng*.jar'
exclude '**/*powermock*.jar'
exclude '**/*mockito*.jar'
exclude '**/*junit*.jar'
exclude '**/*jacoco*.jar'
exclude '**/*log4j2.xml*'
exclude '**/spring-boot-devtools*.jar'
exclude '**/mumble-sdk-test*.jar'
exclude '*connector-rocketmq*.jar'
exclude 'eventmesh-runtime*.jar'
exclude 'commons-collections-3.2.2.jar'
}
copy {
into '../dist/bin'
from '../eventmesh-runtime/bin'
}
copy {
into '../dist/conf'
from '../eventmesh-runtime/conf'
}
}
}
javadoc {
source = sourceSets.main.java
destinationDir = reporting.file("javadoc")
}
task packageJavadoc(type: Jar, dependsOn: ['javadoc']) {
from project.javadoc.destinationDir
classifier = 'javadoc'
}
task packageSources(type: Jar) {
from project.sourceSets.main.allSource
classifier = 'sources' // either here or in artifacts block
}
artifacts {
archives jar
archives packageJavadoc
archives packageSources
}
if (!Boolean.valueOf(signEnabled)) {
tasks.whenTaskAdded { task ->
if (task.name.contains("sign")) {
task.enabled = false
}
}
}
repositories {
maven { url "https://maven.aliyun.com/repository/public" }
mavenCentral()
mavenLocal()
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, TimeUnit.SECONDS
resolutionStrategy.cacheDynamicVersionsFor 0, TimeUnit.SECONDS
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact packageSources
artifact packageJavadoc
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'EventMesh'
description = 'Apache EventMesh'
url = 'https://github.com/apache/incubator-eventmesh'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'Apache EventMesh(incubating)'
name = 'Apache EventMesh(incubating) of ASF'
url = 'https://eventmesh.apache.org/'
}
}
scm {
connection = 'scm:git:git@github.com:apache/incubator-eventmesh.git'
developerConnection = 'scm:git:git@github.com:apache/incubator-eventmesh.git'
url = 'https://github.com/apache/incubator-eventmesh'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://repository.apache.org/content/repositories/releases/'
def snapshotsRepoUrl = 'https://repository.apache.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username apacheUserName
password apachePassWord
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
dependencyManagement {
dependencies {
dependency "org.apache.commons:commons-lang3:3.6"
dependency "org.apache.commons:commons-collections4:4.1"
dependency "commons-io:commons-io:2.4"
dependency "org.apache.commons:commons-text:1.9"
dependency "com.google.guava:guava:29.0-jre"
dependency "org.slf4j:slf4j-api:1.7.30"
dependency "org.apache.logging.log4j:log4j-api:2.13.3"
dependency "org.apache.logging.log4j:log4j-core:2.13.3"
dependency "org.apache.logging.log4j:log4j-core:2.13.3"
dependency "org.apache.logging.log4j:log4j-slf4j-impl:2.13.3"
dependency "org.apache.logging.log4j:log4j-web:2.13.3"
dependency "com.lmax:disruptor:3.4.2"
dependency "com.alibaba:fastjson:1.2.71"
dependency "com.fasterxml.jackson.core:jackson-databind:2.11.0"
dependency "com.fasterxml.jackson.core:jackson-core:2.11.0"
dependency "com.fasterxml.jackson.core:jackson-annotations:2.11.0"
dependency "org.apache.httpcomponents:httpclient:4.5.2"
dependency "io.netty:netty-all:4.1.49.Final"
dependency 'io.dropwizard.metrics:metrics-core:4.1.0'
dependency "io.dropwizard.metrics:metrics-healthchecks:4.1.0"
dependency "io.dropwizard.metrics:metrics-annotation:4.1.0"
dependency "io.dropwizard.metrics:metrics-json:4.1.0"
dependency "io.openmessaging:openmessaging-api:2.2.1-pubsub"
dependency "com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0"
dependency "com.mebigfatguy.fb-contrib:fb-contrib:7.4.7"
dependency "org.springframework.boot:spring-boot-starter-web:2.1.6.RELEASE"
dependency "junit:junit:4.12"
dependency "com.github.stefanbirkner:system-rules:1.16.1"
dependency "org.assertj:assertj-core:2.6.0"
dependency "org.mockito:mockito-core:2.23.0"
dependency "org.powermock:powermock-module-junit4:2.0.2"
dependency "org.powermock:powermock-api-mockito2:2.0.2"
}
}
}
Java
1
https://gitee.com/tianbuaa/EventMesh.git
git@gitee.com:tianbuaa/EventMesh.git
tianbuaa
EventMesh
incubator-eventmesh
develop

搜索帮助