Skip to content

Commit

Permalink
Squashed 'runtimes/' changes from 0bcf347..4736d63
Browse files Browse the repository at this point in the history
4736d63 Merge pull request #16 from jianghaolu/checkstyle
9b363b4 Making corresponding changes to gradle
122b780 Update travis to install build tools
62865c0 Move checkstyle to build-tools
eb8754b Add checkstyle to travis build
de698f7 Optional suppression file for maven scenario
55702f0 Merge commit 'bebdec5b1bbf8d0d2b6be78eb00cd2fc85646763' into checkstyle
9071c8d Add checkstyle rules
7282bf8 Merge pull request #14 from jianghaolu/ua
13575b4 Pull runtimes subtree

git-subtree-dir: runtimes
git-subtree-split: 4736d63
  • Loading branch information
jianghaolu committed Jun 6, 2016
1 parent bebdec5 commit 469f442
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ android:
- extra-android-m2repository
sudo: false
script:
- mvn clean package
- mvn clean install
- mvn checkstyle:check
- cd ./azure-android-client-authentication && ./gradlew check
7 changes: 4 additions & 3 deletions azure-client-authentication/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ apply plugin: 'checkstyle'
version = '1.0.0-SNAPSHOT'

checkstyle {
configFile = new File("$rootDir/ClientRuntimes/Java/checkstyle/checkstyle.xml")
configProperties = [samedir: "$rootDir/ClientRuntimes/Java/checkstyle"]
reportsDir = new File("$rootDir/ClientRuntimes/Java/checkstyle/reports")
toolVersion = "6.18"
configFile = new File("$rootDir/ClientRuntimes/Java/build-tools/src/main/resources/checkstyle.xml")
configProperties = [samedir: "$rootDir/ClientRuntimes/Java/build-tools/src/main/resources"]
reportsDir = new File("$rootDir/ClientRuntimes/Java/build-tools/reports")
}

dependencies {
Expand Down
8 changes: 4 additions & 4 deletions azure-client-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ apply plugin: 'checkstyle'
version = '1.0.0-SNAPSHOT'

checkstyle {
toolVersion = "6.9"
configFile = new File("$rootDir/ClientRuntimes/Java/checkstyle/checkstyle.xml")
configProperties = [samedir: "$rootDir/ClientRuntimes/Java/checkstyle"]
reportsDir = new File("$rootDir/ClientRuntimes/Java/checkstyle/reports")
toolVersion = "6.18"
configFile = new File("$rootDir/ClientRuntimes/Java/build-tools/src/main/resources/checkstyle.xml")
configProperties = [samedir: "$rootDir/ClientRuntimes/Java/build-tools/src/main/resources"]
reportsDir = new File("$rootDir/ClientRuntimes/Java/build-tools/reports")
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.ServiceResponseCallback;
import com.microsoft.rest.ServiceResponseWithHeaders;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Url;

import java.io.IOException;
import java.lang.reflect.Type;
Expand All @@ -22,13 +28,6 @@
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Url;

/**
* An instance of this class defines a ServiceClient that handles polling and
* retrying for long running operations when accessing Azure resources.
Expand Down Expand Up @@ -288,8 +287,7 @@ public <T> ServiceResponse<T> getPostOrDeleteResult(Response<ResponseBody> respo
}

// Check if operation failed
if (AzureAsyncOperation.getFailedStatuses().contains(pollingState.getStatus()))
{
if (AzureAsyncOperation.getFailedStatuses().contains(pollingState.getStatus())) {
throw new CloudException("Async operation failed");
}

Expand Down Expand Up @@ -778,7 +776,7 @@ class PutPatchPollingTask<T> extends AsyncPollingTask<T> {
* @param serviceCall the ServiceCall object tracking Retrofit calls.
* @param clientCallback the client callback to call when a terminal status is hit.
*/
public PutPatchPollingTask(final PollingState<T> pollingState, final String url, final ServiceCall serviceCall, final ServiceCallback<T> clientCallback) {
PutPatchPollingTask(final PollingState<T> pollingState, final String url, final ServiceCall serviceCall, final ServiceCallback<T> clientCallback) {
this.serviceCall = serviceCall;
this.pollingState = pollingState;
this.url = url;
Expand Down Expand Up @@ -835,7 +833,7 @@ class PostDeletePollingTask<T> extends AsyncPollingTask<T> {
* @param serviceCall the ServiceCall object tracking Retrofit calls.
* @param clientCallback the client callback to call when a terminal status is hit.
*/
public PostDeletePollingTask(final PollingState<T> pollingState, final ServiceCall serviceCall, final ServiceCallback<T> clientCallback) {
PostDeletePollingTask(final PollingState<T> pollingState, final ServiceCall serviceCall, final ServiceCallback<T> clientCallback) {
this.serviceCall = serviceCall;
this.pollingState = pollingState;
this.clientCallback = clientCallback;
Expand Down Expand Up @@ -867,8 +865,7 @@ public void run() {
}
} else {
// Check if operation failed
if (AzureAsyncOperation.getFailedStatuses().contains(pollingState.getStatus()))
{
if (AzureAsyncOperation.getFailedStatuses().contains(pollingState.getStatus())) {
clientCallback.failure(new ServiceException("Async operation failed"));
} else {
clientCallback.success(new ServiceResponse<>(pollingState.getResource(), pollingState.getResponse()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import com.microsoft.rest.RestException;

import javax.xml.bind.DataBindingException;
import javax.xml.ws.WebServiceException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
Expand All @@ -17,9 +19,6 @@
import java.util.ListIterator;
import java.util.NoSuchElementException;

import javax.xml.bind.DataBindingException;
import javax.xml.ws.WebServiceException;

/**
* Defines a list response from a paging operation. The pages are
* lazy initialized when an instance of this class is iterated.
Expand Down Expand Up @@ -128,7 +127,7 @@ private class ListItr implements ListIterator<E> {
*
* @param index the position in the list to start.
*/
public ListItr(int index) {
ListItr(int index) {
itemsListItr = items.listIterator(index);
}

Expand Down
47 changes: 47 additions & 0 deletions build-tools/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>autorest-clientruntime-for-java</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>autorest-build-tools</artifactId>
<packaging>jar</packaging>

<name>Build tools for AutoRest client runtime for Java</name>
<description>This package contains the build tools for AutoRest generated Java clients.</description>
<url>https://github.com/Azure/autorest-clientruntime-for-java</url>

<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>scm:git:https://github.com/Azure/autorest-clientruntime-for-java</url>
<connection>scm:git:git@github.com:Azure/autorest-clientruntime-for-java.git</connection>
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>

<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
</module>
<module name="SuppressionFilter">
<property name="file" value="${samedir}/suppressions.xml"/>
<property name="optional" value="true"/>
</module>

<!--
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions client-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ group = 'com.microsoft.rest'
version = '1.0.0-SNAPSHOT'

checkstyle {
toolVersion = "6.9"
configFile = new File("$rootDir/ClientRuntimes/Java/checkstyle/checkstyle.xml")
configProperties = [samedir: "$rootDir/ClientRuntimes/Java/checkstyle"]
reportsDir = new File("$rootDir/ClientRuntimes/Java/checkstyle/reports")
toolVersion = "6.18"
configFile = new File("$rootDir/ClientRuntimes/Java/build-tools/src/main/resources/checkstyle.xml")
configProperties = [samedir: "$rootDir/ClientRuntimes/Java/build-tools/src/main/resources"]
reportsDir = new File("$rootDir/ClientRuntimes/Java/build-tools/reports")
}

dependencies {
Expand Down
40 changes: 27 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
<testMode>playback</testMode>
</properties>

<developers>
Expand Down Expand Up @@ -143,6 +142,29 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>autorest-build-tools</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>6.18</version>
</dependency>
</dependencies>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<propertyExpansion>samedir=build-tools/src/main/resources</propertyExpansion>
<suppressionsLocation>suppressions.xml</suppressionsLocation>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -172,12 +194,6 @@
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand All @@ -195,9 +211,6 @@
<include>**/*Tests.java</include>
<include>**/*TestCase.java</include>
</includes>
<environmentVariables>
<test.mode>${testMode}</test.mode>
</environmentVariables>
</configuration>
</plugin>
<plugin>
Expand All @@ -209,8 +222,9 @@
</pluginManagement>
</build>
<modules>
<module>./client-runtime</module>
<module>./azure-client-runtime</module>
<module>./azure-client-authentication</module>
<module>build-tools</module>
<module>client-runtime</module>
<module>azure-client-runtime</module>
<module>azure-client-authentication</module>
</modules>
</project>

0 comments on commit 469f442

Please sign in to comment.