Skip to content

Commit

Permalink
minor code cleanup and sources and javadoc jars
Browse files Browse the repository at this point in the history
  • Loading branch information
markrileybot committed Dec 5, 2016
1 parent c60290b commit 3139e7c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
38 changes: 27 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ group = 'com.github.markrileybot.heatshrink'
version = '0.0.2-SNAPSHOT'

dependencies {
compile 'org.slf4j:slf4j-api:1.7.21'
testCompile 'junit:junit:4.12'
testCompile 'commons-io:commons-io:2.5'
testCompile files(sourceSets.test.resources.srcDirs)
compile 'org.slf4j:slf4j-api:1.7.21'
testCompile 'junit:junit:4.12'
testCompile 'commons-io:commons-io:2.5'
testCompile files(sourceSets.test.resources.srcDirs)
}

jacocoTestReport {
Expand All @@ -29,18 +29,34 @@ jacocoTestReport {
}
}

task sourceJar(type: Jar) {
from sourceSets.main.allJava
}

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

publishing {
publications {
MyPublication(MavenPublication) {
from components.java
}
}
publications {
mavenJava(MavenPublication) {
from components.java

artifact sourceJar {
classifier 'sources'
}

artifact javadocJar {
classifier 'javadoc'
}
}
}
}

bintray {
user = 'markrileybot'
user = 'markrileybot'
key = System.getenv('BINTRAY_KEY')
publications = ['MyPublication']
publications = ['mavenJava']
pkg {
repo = 'markrileybot'
name = project.name
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/heatshrink/HsInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public HsInputStream(java.io.InputStream in, int bufferSize, int windowSize, int
this.window = new byte[1 << windowSize];
this.windowSize = windowSize;
this.lookaheadSize = lookaheadSize;
clear(in);
clear();
}

/**
Expand Down Expand Up @@ -379,9 +379,18 @@ public boolean markSupported() {

/**
* Prepare this for reuse
*
* @param in A new input stream
*/
public void clear(InputStream in) {
this.in = in;
clear();
}

/**
* Prepare this for reuse
*/
private void clear() {
state = State.TAG_BIT;
outputCount = outputIndex = 0;
inputBufferPos = inputBufferLen = 0;
Expand Down

0 comments on commit 3139e7c

Please sign in to comment.