Skip to content

Commit

Permalink
Merge pull request Azure#803 from jianghaolu/moredev
Browse files Browse the repository at this point in the history
Fix credentials tests and add functionality to view diff in adxsnapshots
  • Loading branch information
amarzavery committed Mar 5, 2016
2 parents 23b9424 + d44df63 commit 1f13aa5
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 8 deletions.
15 changes: 13 additions & 2 deletions azure-android-client-authentication/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ uploadArchives {
}
}

task versionInfo(type:Exec){
commandLine 'git rev-parse HEAD'.split()
ext.versionfile = new File("${projectDir}/.gitrevision")
standardOutput = new ByteArrayOutputStream()

doLast {
versionfile.text = "Azure/autorest#" + standardOutput.toString()
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
Expand All @@ -97,12 +107,13 @@ task javadoc(type: Javadoc) {
options.encoding = 'UTF-8'
}

task javadocJar(type: Jar, dependsOn: javadoc) {
task javadocJar(type: Jar, dependsOn: [javadoc, versionInfo]) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
archives javadocJar
archives file: file("${projectDir}/.gitrevision")
}
13 changes: 12 additions & 1 deletion azure-client-authentication/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ test {
}
}

task versionInfo(type:Exec){
commandLine 'git rev-parse HEAD'.split()
ext.versionfile = new File("${projectDir}/.gitrevision")
standardOutput = new ByteArrayOutputStream()

doLast {
versionfile.text = "Azure/autorest#" + standardOutput.toString()
}
}

javadoc {
options.encoding = 'UTF-8'
}
Expand All @@ -79,14 +89,15 @@ task sourcesJar(type: Jar, dependsOn:classes) {
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
task javadocJar(type: Jar, dependsOn: [javadoc, versionInfo]) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
archives file: file("${projectDir}/.gitrevision")
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class UserTokenCredentialsTests {
public void testAcquireToken() throws Exception {
credentials.refreshToken();
Assert.assertEquals("token1", credentials.getToken());
Thread.sleep(1000);
Thread.sleep(1500);
Assert.assertEquals("token2", credentials.getToken());
}

Expand Down Expand Up @@ -62,7 +62,7 @@ private void acquireAccessToken() throws IOException {
null,
"token1",
"refresh",
0,
1,
null,
null,
false);
Expand All @@ -73,7 +73,7 @@ private void acquireAccessTokenFromRefreshToken() throws IOException {
null,
"token2",
"refresh",
0,
1,
null,
null,
false);
Expand Down
13 changes: 12 additions & 1 deletion azure-client-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ test {
}
}

task versionInfo(type:Exec){
commandLine 'git rev-parse HEAD'.split()
ext.versionfile = new File("${projectDir}/.gitrevision")
standardOutput = new ByteArrayOutputStream()

doLast {
versionfile.text = "Azure/autorest#" + standardOutput.toString()
}
}

javadoc {
options.encoding = 'UTF-8'
}
Expand All @@ -79,14 +89,15 @@ task sourcesJar(type: Jar, dependsOn:classes) {
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
task javadocJar(type: Jar, dependsOn: [javadoc, versionInfo]) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
archives file: file("${projectDir}/.gitrevision")
}

test {
Expand Down
13 changes: 12 additions & 1 deletion client-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ test {
}
}

task versionInfo(type:Exec){
commandLine 'git rev-parse HEAD'.split()
ext.versionfile = new File("${projectDir}/.gitrevision")
standardOutput = new ByteArrayOutputStream()

doLast {
versionfile.text = "Azure/autorest#" + standardOutput.toString()
}
}

javadoc {
options.encoding = 'UTF-8'
}
Expand All @@ -88,14 +98,15 @@ task sourcesJar(type: Jar, dependsOn:classes) {
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
task javadocJar(type: Jar, dependsOn: [javadoc, versionInfo]) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
archives file: file("${projectDir}/.gitrevision")
}

test {
Expand Down

0 comments on commit 1f13aa5

Please sign in to comment.