Skip to content

Commit

Permalink
Merge pull request #1 from qqeasonchen/master
Browse files Browse the repository at this point in the history
merge change list from eventmesh
  • Loading branch information
qqeasonchen authored Aug 3, 2020
2 parents 0e4fd2d + 52c5cc8 commit d206dbf
Show file tree
Hide file tree
Showing 42 changed files with 2,135 additions and 800 deletions.
150 changes: 87 additions & 63 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,25 @@ buildscript {
maven {
url "https://maven.aliyun.com/repository/public"
}

maven {
url "https://plugins.gradle.org/m2/"
}

}

dependencies {
classpath("net.sourceforge.pmd:pmd-java:5.4.1")
classpath("com.puppycrawl.tools:checkstyle:6.16.1")
classpath("com.google.code.findbugs:findbugs:3.0.1")
classpath("gradle.plugin.com.github.kt3k.coveralls:coveralls-gradle-plugin:2.8.4")
//classpath("net.sourceforge.pmd:pmd-java:5.4.1")
//classpath("com.puppycrawl.tools:checkstyle:6.16.1")
classpath("gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.0.7")
classpath('com.github.spotbugs:spotbugs:4.0.0')
}
}

allprojects {
apply plugin: 'java'


clean.doFirst {
delete 'build'
delete 'dist'
Expand All @@ -49,7 +52,7 @@ allprojects {
}
}

task tar(overwrite: true, type: Tar) {
task tar(type: Tar) {
extension = 'tar.gz'
compression = Compression.GZIP
archiveName = project.name + '_' + project.version + '.' + extension
Expand All @@ -59,7 +62,7 @@ task tar(overwrite: true, type: Tar) {
}
}

task zip(overwrite: true, type: Zip) {
task zip(type: Zip) {
extension = 'zip'
archiveName = project.name + '.' + project.version + '.' + extension
destinationDir = new File(projectDir, 'build')
Expand All @@ -69,40 +72,75 @@ task zip(overwrite: true, type: Zip) {
}

subprojects {
apply plugin: "java"


apply plugin: "maven"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "project-reports"
apply plugin: "jacoco"
apply plugin: "checkstyle"
apply plugin: "pmd"
apply plugin: "findbugs"
apply plugin: "com.github.kt3k.coveralls"
apply plugin: 'com.github.spotbugs'

[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'

compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"

jacoco {
toolVersion = "0.7.7.201606060606"
toolVersion = "0.8.5"
reportsDir = file("$buildDir/reports/jacoco")
}

jacocoTestReport {
// sourceSets sourceSets.main
// executionData files("$buildDir/jacoco/jacocoTest.exec")

reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/reports/jacoco")
}
}

checkstyle {
checkstyle.toolVersion = "6.19"
toolVersion = "8.32"
ignoreFailures = true
sourceSets = [sourceSets.main]
configFile = 'conf/checkstyle.xml' as File
showViolations true
}

tasks.withType(Checkstyle) {
reports {
xml.enabled false
html.enabled true
}
}

findbugs {
spotbugs {
toolVersion = '4.0.2'
ignoreFailures = true
findbugsTest.enabled = false
sourceSets = [sourceSets.main]
effort = "default"
reportLevel = "default"
showProgress = true
}

tasks.withType(FindBugs) {
// tasks.withType(com.github.spotbugs.SpotBugsTask) {
// sourceDirs = [sourceSets.main]
// reports {
// xml.enabled = false
// html.enabled = true
// }
// }
spotbugsMain {
reports {
xml.enabled = false
html.enabled = true
}
}

spotbugsTest {
reports {
xml.enabled = false
html.enabled = true
Expand All @@ -116,74 +154,47 @@ subprojects {
}
}


pmd {
consoleOutput = true
toolVersion = "6.23.0"
rulePriority = 5
ruleSets = ["category/java/errorprone.xml", "category/java/bestpractices.xml"]
ignoreFailures = true
pmdTest.enabled = false
sourceSets = [sourceSets.main]
ruleSets = [
'java-basic',
'java-braces',
'java-clone',
'java-codesize',
'java-comments',
'java-controversial',
'java-coupling',
'java-design',
'java-empty',
'java-finalizers',
'java-imports',
'java-optimizations',
'java-strictexception',
'java-strings',
'java-typeresolution',
'java-unnecessary',
'java-unusedcode'
]
}

task jacocoAllTestReport(type: JacocoReport, dependsOn: ["test"]) {
sourceSets sourceSets.main
executionData files("$buildDir/jacoco/test.exec")
reports {
html.enabled = true // human readable
xml.enabled = true // required by coveralls
}
}

coveralls{
jacocoReportPath="${buildDir}/reports/jacoco/jacocoAllTestReport/jacocoAllTestReport.xml"
}

List junit = [
"junit:junit:4.12"
"junit:junit:4.12"
]

List apache_commons = [
"org.apache.commons:commons-collections4:4.1",
"commons-beanutils:commons-beanutils:1.9.3",
"org.apache.commons:commons-lang3:3.6",
"commons-codec:commons-codec:1.10"
"org.apache.commons:commons-collections4:4.1",
"commons-beanutils:commons-beanutils:1.9.3",
"org.apache.commons:commons-lang3:3.6",
"commons-codec:commons-codec:1.10"

]

List logback = [
"org.slf4j:slf4j-api:1.7.25"
"org.slf4j:slf4j-api:1.7.25"
]

List guava = [
"com.google.guava:guava:20.0"
"com.google.guava:guava:20.0"
]

List fastjson = [
"com.alibaba:fastjson:1.2.61"
"com.alibaba:fastjson:1.2.71"
]

List common_io = [
"commons-io:commons-io:2.4"
"commons-io:commons-io:2.4"
]

List assertj = [
"org.assertj:assertj-core:2.6.0"
"org.assertj:assertj-core:2.6.0"
]

List mock = [
Expand All @@ -202,12 +213,12 @@ subprojects {
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")
"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")
)
}
}
Expand Down Expand Up @@ -286,5 +297,18 @@ subprojects {
resolutionStrategy.cacheDynamicVersionsFor 0, TimeUnit.SECONDS
}

uploadArchives {
repositories {
mavenDeployer {
snapshotRepository(url: 'file://D:\\LocalRepo') {
authentication(userName: 'Your user name', password: 'Your password')
}
repository(url: 'file://D:\\LocalRepo') {
authentication(userName: 'Your user name', password: 'Your password')
}
}
}
}

}

Loading

0 comments on commit d206dbf

Please sign in to comment.