Skip to content

Commit a2b285c

Browse files
authored
Merge pull request #1 from devxchangeio/gradle_cleanup
Gradle cleanup
2 parents 28860b4 + 7fff933 commit a2b285c

15 files changed

Lines changed: 539 additions & 85 deletions

File tree

.idea/.gitignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
image:https://travis-ci.com/devxchangeio/logmetrics-java.svg?branch=master["Build Status", link="https://travis-ci.com/devxchangeio/logmetrics-java"]
2-
image:https://coveralls.io/repos/github/devxchangeio/logmetrics-java/badge.svg?branch=master["Coverage Status",link="https://coveralls.io/github/devxchangeio/logmetrics-java?branch=master"]
3-
2+
image:https://api.bintray.com/packages/devxchange/logmetrics/logmetrics-java/images/download.svg?version=0.0.2-SNAPSHOT[link="https://bintray.com/devxchange/logmetrics/logmetrics-java/0.0.2-SNAPSHOT/link"]
43

54
## logmetrics
65

build.gradle

Lines changed: 58 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,96 @@
11
buildscript {
2-
ext {
3-
springBootVersion = '1.5.1.RELEASE'
4-
}
5-
repositories {
6-
mavenCentral()
7-
jcenter()
8-
9-
10-
}
11-
dependencies {
12-
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
13-
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1"
14-
15-
}
2+
ext {
3+
springBootVersion = '1.5.1.RELEASE'
4+
}
5+
repositories {
6+
mavenCentral()
7+
jcenter()
8+
}
9+
dependencies {
10+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
11+
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
12+
}
1613
}
1714

1815
apply plugin: 'java'
1916
apply plugin: 'eclipse'
2017
apply plugin: 'maven-publish'
2118
apply plugin: 'maven'
22-
apply plugin: 'jacoco'
19+
apply plugin: 'com.jfrog.bintray'
20+
2321

2422
group 'io.devxchange'
25-
version '0.0.2-SNAPSHOT'
23+
version '1.0.0'
2624
archivesBaseName = "logmetrics"
2725

2826

2927
sourceCompatibility = 1.8
3028

3129
repositories {
32-
mavenCentral()
33-
maven { url "https://repo.spring.io/snapshot" }
34-
maven { url "https://repo.spring.io/milestone" }
30+
mavenCentral()
31+
maven { url "https://repo.spring.io/snapshot" }
32+
maven { url "https://repo.spring.io/milestone" }
3533
}
3634

3735

3836
dependencies {
39-
compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.2.RELEASE'
37+
compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.2.RELEASE'
4038
compile("javax.servlet:javax.servlet-api:3.1.0")
41-
compile group: 'commons-io', name: 'commons-io', version: '2.4'
39+
compile group: 'commons-io', name: 'commons-io', version: '2.4'
4240
compile("com.google.code.gson:gson:2.3.1")
4341
compile("com.jayway.jsonpath:json-path:2.0.0")
44-
compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
42+
compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
4543
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
46-
compile group: 'commons-collections', name: 'commons-collections', version: '3.0'
47-
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.4'
48-
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.4'
44+
compile group: 'commons-collections', name: 'commons-collections', version: '3.0'
45+
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.4'
46+
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.4'
4947

5048
}
5149

52-
task javadocJar(type: Jar) {
53-
classifier = 'javadoc'
54-
from javadoc
55-
}
56-
57-
task sourcesJar(type: Jar) {
50+
// custom tasks for creating source/javadoc jars
51+
task sourcesJar(type: Jar, dependsOn: classes) {
5852
classifier = 'sources'
5953
from sourceSets.main.allSource
6054
}
6155

62-
jacocoTestReport {
63-
reports {
64-
xml.enabled true
65-
html.enabled false
66-
}
56+
task javadocJar(type: Jar, dependsOn: javadoc) {
57+
classifier = 'javadoc'
58+
from javadoc.destinationDir
6759
}
6860

69-
check.dependsOn jacocoTestReport
70-
7161
artifacts {
72-
archives javadocJar, sourcesJar
62+
archives sourcesJar, javadocJar
7363
}
7464

7565
publishing {
76-
publications {
77-
mavenJava(MavenPublication) {
78-
from components.java
79-
}
80-
}
81-
82-
repositories {
83-
mavenLocal()
84-
85-
maven {
86-
credentials {
87-
username "$ossrhUsername"
88-
password "$ossrhPassword"
89-
}
90-
91-
if(project.version.endsWith('-SNAPSHOT')) {
92-
url "https://oss.sonatype.org/content/repositories/snapshots"
93-
} else {
94-
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
95-
}
96-
}
97-
}
66+
publications {
67+
MyPublication(MavenPublication) {
68+
from components.java
69+
groupId 'io.devxchange'
70+
artifactId 'logmetrics'
71+
version '1.0.0'
72+
}
73+
}
9874
}
9975

100-
76+
bintray {
77+
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
78+
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
79+
publications = ['MyPublicaiton']
80+
dryRun = false
81+
publish = true
82+
pkg {
83+
repo = 'logmetrics'
84+
name = 'logmetrics-java'
85+
userOrg = 'devxchange'
86+
licenses = ['Apache-2.0']
87+
vcsUrl = 'https://github.com/devxchangeio/logmetrics-java.git'
88+
labels = ['devxchangeio', 'logmetrics']
89+
publicDownloadNumbers = true
90+
attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes
91+
version {
92+
name = '1.0.0-Final'
93+
desc = 'LogMetrics for Java Projects 1.0 final'
94+
}
95+
}
96+
}

build.gradle.txt

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
buildscript {
2+
ext {
3+
springBootVersion = '1.5.1.RELEASE'
4+
}
5+
repositories {
6+
mavenCentral()
7+
jcenter()
8+
9+
10+
}
11+
dependencies {
12+
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
13+
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1"
14+
15+
}
16+
}
17+
18+
apply plugin: 'java'
19+
apply plugin: 'eclipse'
20+
apply plugin: 'maven-publish'
21+
apply plugin: 'maven'
22+
apply plugin: 'jacoco'
23+
24+
group 'io.devxchange'
25+
version '0.0.1-SNAPSHOT'
26+
archivesBaseName = "logmetrics"
27+
28+
29+
sourceCompatibility = 1.8
30+
31+
repositories {
32+
mavenCentral()
33+
maven { url "https://repo.spring.io/snapshot" }
34+
maven { url "https://repo.spring.io/milestone" }
35+
}
36+
37+
38+
dependencies {
39+
compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.2.RELEASE'
40+
compile("javax.servlet:javax.servlet-api:3.1.0")
41+
compile group: 'commons-io', name: 'commons-io', version: '2.4'
42+
compile("com.google.code.gson:gson:2.3.1")
43+
compile("com.jayway.jsonpath:json-path:2.0.0")
44+
compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
45+
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
46+
compile group: 'commons-collections', name: 'commons-collections', version: '3.0'
47+
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.4'
48+
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.4'
49+
50+
}
51+
52+
task javadocJar(type: Jar) {
53+
classifier = 'javadoc'
54+
from javadoc
55+
}
56+
57+
task sourcesJar(type: Jar) {
58+
classifier = 'sources'
59+
from sourceSets.main.allSource
60+
}
61+
62+
jacocoTestReport {
63+
reports {
64+
xml.enabled true
65+
html.enabled false
66+
}
67+
}
68+
69+
check.dependsOn jacocoTestReport
70+
71+
artifacts {
72+
archives javadocJar, sourcesJar
73+
}
74+
75+
publishing {
76+
publications {
77+
mavenJava(MavenPublication) {
78+
from components.java
79+
}
80+
}
81+
82+
repositories {
83+
mavenLocal()
84+
85+
maven {
86+
credentials {
87+
username "$ossrhUsername"
88+
password "$ossrhPassword"
89+
}
90+
91+
if(project.version.endsWith('-SNAPSHOT')) {
92+
url "https://oss.sonatype.org/content/repositories/snapshots"
93+
} else {
94+
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
95+
}
96+
}
97+
}
98+
}
99+
100+

gradle.properties

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
ossrhUsername=
2-
ossrhPassword=
3-
artifactory_contextUrl=
1+
bintrayUser=sadayamuthu
2+
bintrayApiKey=9910ec2fb663a78db66b629eb1bdf836343ae2f4
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Dec 20 22:49:49 EST 2016
1+
#Wed Nov 20 01:00:14 EST 2019
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip
23
distributionBase=GRADLE_USER_HOME
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

gradlew

100644100755
Lines changed: 17 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

logmetrics-java/build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*
4+
* This generated file contains a sample Java Library project to get you started.
5+
* For more details take a look at the Java Libraries chapter in the Gradle
6+
* User Manual available at https://docs.gradle.org/5.6.1/userguide/java_library_plugin.html
7+
*/
8+
9+
plugins {
10+
// Apply the java-library plugin to add support for Java Library
11+
id 'java-library'
12+
}
13+
14+
repositories {
15+
// Use jcenter for resolving dependencies.
16+
// You can declare any Maven/Ivy/file repository here.
17+
jcenter()
18+
}
19+
20+
dependencies {
21+
// This dependency is exported to consumers, that is to say found on their compile classpath.
22+
api 'org.apache.commons:commons-math3:3.6.1'
23+
24+
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
25+
implementation 'com.google.guava:guava:28.0-jre'
26+
27+
// Use JUnit test framework
28+
testImplementation 'junit:junit:4.12'
29+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)