Skip to content

Commit

Permalink
4.1.0
Browse files Browse the repository at this point in the history
- Switch to testng
- Upgrade gradle
- Add to bintray/jcenter
  • Loading branch information
a-hansen authored Apr 27, 2019
1 parent a678703 commit cb2f38c
Show file tree
Hide file tree
Showing 12 changed files with 159 additions and 57 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ number of zip backups will be trimmed to a configurable maximum.
There are two ways to use Alog: programmatically and with configuration
files.

Dependency Management
---------------------

**Repository** : JCenter
**groupId** : com.comfortanalytics
**artifactId** : alog

Programmatic Usage
------------------

Expand Down
124 changes: 110 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,132 @@
apply plugin: 'java'
apply plugin: 'maven'
plugins {
id 'java-library'
id 'com.jfrog.bintray' version '1.8.4'
id 'maven-publish'
}

version '4.1.0'
group 'com.comfortanalytics'
description 'Async Java Util Logging'

group 'alog'
version '4.0.1'
def projectUrl = 'https://github.com/a-hansen/alog'
def vcsUrl = 'https://github.com/a-hansen/alog.git'
def scmUrl = 'scm:https://github.com/a-hansen/alog.git'
def issuesUrl = 'https://github.com/a-hansen/alog/issues'
def githubRepo = 'a-hansen/alog'
def developerId = 'a-hansen'
def developerName = 'Aaron Hansen'
def developerOrg = 'Comfort Analytics'
def developerOrgUrl = 'http://comfortanalytics.com'

sourceCompatibility = 1.5
targetCompatibility = 1.5
sourceCompatibility = JavaVersion.VERSION_1_5
targetCompatibility = JavaVersion.VERSION_1_5

repositories {
mavenCentral()
jcenter()
}

dependencies {
testImplementation 'junit:junit:+'
testImplementation 'org.testng:testng:6.14.3'
}

task wrapper(type: Wrapper) {
gradleVersion = '4.8.1'
test {
useTestNG()
}

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

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
archives sourcesJar, javadocJar
}

wrapper {
gradleVersion = '5.4'
}

// Jcenter
// -------

bintray {
user = project.properties.bintrayUser
key = project.properties.bintrayApiKey
publications = ['MyPublication']
dryRun = false
publish = true
override = true
pkg {
repo = project.group
name = project.name
licenses = ['ISC']
desc = project.description
vcsUrl = vcsUrl
websiteUrl = projectUrl
issueTrackerUrl = issuesUrl
githubRepo = githubRepo
githubReleaseNotesFile = 'README.md'
version {
name = project.version
desc = project.description
released = new Date()
vcsTag = project.version
mavenCentralSync {
sync = false //[Default: true] Determines whether to sync the version to Maven Central.
user = project.properties.ossrhUser
password = project.properties.ossrhPass
}
}
}
publications = ['MyPublication']
}

// Create the pom configuration:
def pomConfig = {
licenses {
license {
name 'ISC License'
url 'http://opensource.org/licenses/ISC'
distribution 'repo'
}
}
developers {
developer {
id developerId
name developerName
email project.properties.developerEmail
organization developerOrg
organizationUrl developerOrgUrl
}
}
scm {
url scmUrl
}
}

// Create the publication with the pom configuration:
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId project.name
version project.version
pom.withXml {
def root = asNode()
root.appendNode('description', project.description)
root.appendNode('name', project.name)
root.appendNode('url', projectUrl)
root.children().last() + pomConfig
}
}
}
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun Jul 08 07:26:36 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/comfortanalytics/alog/AlogTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
* @author Aaron Hansen
Expand All @@ -16,12 +16,12 @@ public class AlogTest {

private File file = new File("test.log");

@Before
@BeforeClass
public void setup() {
LogManager.getLogManager().reset();
}

@After
@AfterClass
public void teardown() {
LogManager.getLogManager().reset();
file.delete();
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/comfortanalytics/alog/BackupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
* @author Aaron Hansen
Expand All @@ -17,14 +17,14 @@ public class BackupTest {
private File file = new File("test.log").getAbsoluteFile();
private FileLogHandler handler;

@Before
@BeforeClass
public void setup() {
LogManager.getLogManager().reset();
file.delete();
handler = FileLogHandler.getHandler(file);
}

@After
@AfterClass
public void teardown() {
LogManager.getLogManager().reset();
for (File f : handler.getBackups()) {
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/comfortanalytics/alog/ConfigFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import java.util.logging.LogManager;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
* @author Aaron Hansen
Expand All @@ -26,12 +26,12 @@ public class ConfigFileTest {
"com.comfortanalytics.alog.inferCaller=true\n" +
"com.comfortanalytics.alog.backupThreshold=100\n";

@Before
@BeforeClass
public void setup() {
LogManager.getLogManager().reset();
}

@After
@AfterClass
public void teardown() {
LogManager.getLogManager().reset();
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/comfortanalytics/alog/ConfigRootTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import java.util.logging.LogManager;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
* @author Aaron Hansen
Expand All @@ -23,7 +23,7 @@ public class ConfigRootTest {
"com.comfortanalytics.alog.inferCaller=true\n" +
"com.comfortanalytics.alog.throttle=85\n";

@Before
@BeforeClass
public void setup() {
LogManager.getLogManager().reset();
Logger root = Alog.rootLogger();
Expand All @@ -32,7 +32,7 @@ public void setup() {
}
}

@After
@AfterClass
public void teardown() {
LogManager.getLogManager().reset();
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/comfortanalytics/alog/FileNameTest.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.comfortanalytics.alog;

import java.io.File;
import org.junit.Assert;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.Test;

/**
* @author Aaron Hansen
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/comfortanalytics/alog/FileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
* @author Aaron Hansen
Expand All @@ -16,13 +16,13 @@ public class FileTest {

private File file = new File("test.log").getAbsoluteFile();

@Before
@BeforeClass
public void setup() {
LogManager.getLogManager().reset();
file.delete();
}

@After
@AfterClass
public void teardown() {
LogManager.getLogManager().reset();
file.delete();
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/comfortanalytics/alog/SameFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.io.File;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
* @author Aaron Hansen
Expand All @@ -15,13 +15,13 @@ public class SameFileTest {

private File file = new File("test.log").getAbsoluteFile();

@Before
@BeforeClass
public void setup() {
LogManager.getLogManager().reset();
file.delete();
}

@After
@AfterClass
public void teardown() {
LogManager.getLogManager().reset();
file.delete();
Expand Down

0 comments on commit cb2f38c

Please sign in to comment.