-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move autorest client to java sdk central repo #3174
Changes from 250 commits
70c635f
057efef
90e8d44
3c44704
3df0ce5
08636bd
2edb8c4
a8f6239
401828c
74b018c
2ba45c1
98ffdb7
3d1393a
1e4f939
56946cd
8fcebf0
486f58c
8d9f17a
1428e5c
1720394
8b52cf8
1394167
9d48071
650a6ac
9b7cf6a
0a5611f
c502ff5
aed2f18
34f461b
78f0f28
ebd371b
8916cf4
fe18ed2
fa2f402
289bfca
c689a0b
60c447b
e2f99af
00e7ef1
d5fbbfd
71ec0e2
5e5ee6b
d416595
96fea38
b1b5996
f1d8c0c
8a773eb
e63b88b
efa0049
bb0fe5b
fe0390f
070390a
92b1fcd
417a516
947c6aa
034f348
f429620
dfa495d
ba5e8a8
a69790d
4c6fc39
56f228e
b57d845
eb28d89
7fc95c1
f9f781c
a58b7de
482df1b
709ebaa
7cd94ea
9043b2c
fb890cc
f19226e
f2ce05b
d6cec5b
5b8636c
a46ec90
0965b1c
95bbef4
caa907b
20dbf0a
9d55342
c236aad
25570a8
f5ea287
490d023
8ab8eed
1806ac5
07fc86f
14705e4
8af3c20
97c1ccf
8a12346
d78f9c3
e86718a
f7f4ecf
6f9fa81
79f0bfa
913fa0c
16df4a8
f23b655
4582181
3cfc5fe
f7dc606
ef928af
04c1e34
5c4fafe
658cd96
8e3103d
ca5bfaa
b103fc9
8d987bb
70efbb4
19239c1
c368604
7784c59
75c0c45
7c4e707
bbed1a9
f849333
14b6280
3ff5dc8
44be63a
6101f5c
ec1d82e
3c7587e
d402e1a
430580b
91dc54e
56e004f
0689b3e
54ffc65
e8c95af
b37e1e6
31d61d9
c2d49fa
22dd100
10934ce
47aed34
f3ff5bf
47f7cd1
1fbbfe3
c090dad
aff8cac
2ba4b0f
7bff1c6
b992a50
98cefba
c59c3a1
3a2ebdb
e74b137
fd8c8a2
0c8b983
ab5a938
7dd4975
0df9f06
5a6c2ee
8707b50
ac0f358
f759638
9205a08
be7995a
29b33eb
5871dbe
08137b4
d9512b5
9125441
e2171de
5ee07f4
7462868
d972054
9b83b42
1b5150d
2a83e2f
c60a789
b160687
58a17ec
5359844
6ca8a13
303e566
1a6797d
c8f24ad
857b5c1
c8fcaac
4743388
40a9487
a1e4708
39ada0a
f89125b
b138dd9
24d7b6d
69faa8a
a042c9b
62167c3
3dca98e
45df0d7
426c5f5
34fa182
057546c
fef3f0e
5443cdc
c27b25f
96e040c
4aeecd9
5fca66e
b88ae31
b9c0997
4c32e86
c1761b7
00e4e47
fcf48ff
0032bb5
b9ffe23
02976d7
a255ad4
089524f
0679596
874a956
0e13372
7bb7731
66b70ae
d5246e3
30fb8a8
5bd2a25
996c7b7
7634db2
34eb87a
0151048
5739b6f
5c4d932
3480480
10c4358
0596f39
555ae15
0ddb139
307b1dd
3eff2d4
c81e682
368e089
d6f8f76
91bc32f
71bc929
a3b64ac
8287c4e
caa5840
16cad94
d81be12
7b66b13
5d61ab9
60304c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
build | ||
*.class | ||
target | ||
gen | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
tmp | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
*.MF | ||
.gitrevision | ||
.gradle | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
# ide | ||
.idea | ||
*.iml | ||
.DS_Store | ||
**/temp/ | ||
|
||
#eclipse | ||
.project | ||
.classpath | ||
.settings | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
language: android | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be removed during clean-up. |
||
android: | ||
components: | ||
- build-tools-23.0.1 | ||
- android-23 | ||
- platform-tools | ||
- extra-android-support | ||
- extra-google-m2repository | ||
- extra-android-m2repository | ||
sudo: false | ||
env: | ||
- TERM=dumb # Makes Gradle use plain console output | ||
script: | ||
- mvn clean install -B -Dstyle.color=always | ||
- mvn checkstyle:check -B -Dstyle.color=always | ||
# (ignore android build for now) | ||
# - cd ./azure-android-client-authentication && ./gradlew check |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
2.0.0-beta4 (2018-08-06) | ||
- Added HttpRequest request() property to RestResponse | ||
- Added isProxyHTTPS() property to HttpClientConfiguration | ||
|
||
2.0.0-beta3 (2018-06-26) | ||
- Added FlowableUtil.ensureLength() operator to better handle cases where the request body had an unexpected size | ||
|
||
2.0.0-beta2 (2018-04-23) | ||
- Major refinements to HTTP content streaming, in large part thanks to contributions by [David Moten](https://github.com/davidmoten). | ||
- Removed Joda Time in favor of Java 8 DateTime classes | ||
- NettyClient.Factory now accepts a Netty Bootstrap object allowing for more user configuration of channel attributes, such as the receive buffer size and low/high write watermarks. Currently, specifying an EventLoopGroup or `Class<? extends Channel>` is not supported. | ||
- Various other minor improvements | ||
|
||
2.0.0-beta1 (2018-03-08) | ||
- First beta featuring Netty and RxJava 2. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be removed during clean-up. |
||
|
||
Copyright (c) 2016 Microsoft Azure | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
[![Build Status](https://travis-ci.org/Azure/autorest-clientruntime-for-java.svg?branch=v2)](https://travis-ci.org/Azure/autorest-clientruntime-for-java) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The README.md files should go under the package folder during clean-up. |
||
|
||
# AutoRest Client Runtimes for Java | ||
The runtime libraries for [AutoRest](https://github.com/azure/autorest) generated Java clients. | ||
|
||
## Usage | ||
|
||
### Prerequisites | ||
|
||
- JDK 1.8 | ||
|
||
### Download | ||
|
||
```xml | ||
<dependencies> | ||
<!-- For generic, non-Azure Resource Management users --> | ||
<dependency> | ||
<groupId>com.microsoft.rest.v3</groupId> | ||
<artifactId>client-runtime</artifactId> | ||
<version>2.0.0-beta4</version> | ||
</dependency> | ||
|
||
<!-- For Azure Resource Management users --> | ||
<dependency> | ||
<groupId>com.microsoft.azure.v3</groupId> | ||
<artifactId>azure-client-runtime</artifactId> | ||
<version>2.0.0-beta4</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.microsoft.azure.v3</groupId> | ||
<artifactId>azure-client-authentication</artifactId> | ||
<version>2.0.0-beta4</version> | ||
</dependency> | ||
|
||
<!-- Below are optional high-performance native dependencies --> | ||
|
||
<!-- Available on Windows/Mac/Linux x86_64 --> | ||
<dependency> | ||
<groupId>io.netty</groupId> | ||
<artifactId>netty-tcnative-boringssl-static</artifactId> | ||
<version>2.0.8.Final</version> | ||
<classifier>${os.detected.classifier}</classifier> | ||
</dependency> | ||
|
||
<!-- Only available on Linux --> | ||
<dependency> | ||
<groupId>io.netty</groupId> | ||
<artifactId>netty-transport-native-epoll</artifactId> | ||
<version>4.1.23.Final</version> | ||
<classifier>${os.detected.classifier}</classifier> | ||
</dependency> | ||
|
||
<!-- Only available on macOS/BSD --> | ||
<dependency> | ||
<groupId>io.netty</groupId> | ||
<artifactId>netty-transport-native-kqueue</artifactId> | ||
<version>4.1.23.Final</version> | ||
<classifier>${os.detected.classifier}</classifier> | ||
</dependency> | ||
</dependencies> | ||
|
||
<!-- Allows automatic detection of OS for native modules --> | ||
<build> | ||
<extensions> | ||
<extension> | ||
<groupId>kr.motd.maven</groupId> | ||
<artifactId>os-maven-plugin</artifactId> | ||
<version>1.6.0</version> | ||
</extension> | ||
</extensions> | ||
</build> | ||
``` | ||
|
||
### Usage | ||
|
||
Non-Azure generated clients will have a constructor that takes no arguments for simple scenarios, while Azure generated clients will require a `ServiceClientCredentials` argument at a minimum. | ||
|
||
If you want to have more control over configuration, consider using HttpPipeline. This enables performing transformations on all HTTP messages sent by a client, similar to interceptors or filters in other HTTP clients. | ||
|
||
You can build an HttpPipeline out of a sequence of RequestPolicyFactories. These policies will get applied in-order to outgoing requests, and then in reverse order for incoming responses. HttpPipelineBuilder includes convenience methods for adding several built-in RequestPolicyFactories, including policies for credentials, logging, response decoding (deserialization), cookies support, and several others. | ||
|
||
```java | ||
// For Java generator | ||
HttpPipeline pipeline = new HttpPipelineBuilder() | ||
.withHostPolicy("http://localhost") | ||
.withDecodingPolicy() | ||
.build(); | ||
AutoRestJavaClient client = new AutoRestJavaClientImpl(pipeline); | ||
|
||
// For Azure.Java generator | ||
HttpPipeline azurePipeline = new HttpPipelineBuilder() | ||
.withCredentialsPolicy(AzureCliCredentials.create()) | ||
.withHttpLoggingPolicy(HttpLogDetailLevel.HEADERS) | ||
.withDecodingPolicy() | ||
.build(); | ||
FooServiceClient azureClient = new FooServiceClientImpl(azurePipeline); | ||
``` | ||
|
||
## Components | ||
|
||
### client-runtime | ||
This is the generic runtime. Add this package as a dependency if you are using `Java` generator in AutoRest. This package depends on [Netty](https://github.com/netty/netty), [Jackson](http://wiki.fasterxml.com/JacksonHome), and [RxJava](https://github.com/ReactiveX/RxJava) for making and processing REST requests. | ||
|
||
### azure-client-runtime | ||
This is the runtime with Azure Resource Management customizations. Add this package as a dependency if you are using `--azure-arm` or `--azure-arm --fluent` generator flags in AutoRest. | ||
|
||
This combination provides a set of Azure specific behaviors, including long running operations, special handling of HEAD operations, and paginated `list()` calls. | ||
|
||
### azure-client-authentication (beta) | ||
This package provides access to Active Directory authentication on JDK using OrgId or application ID / secret combinations. There are currently 3 types of authentication provided: | ||
|
||
- Service principal authentication: `ApplicationTokenCredentials` | ||
- Username / password login without multi-factor auth: `UserTokenCredentials` | ||
- Use the credentials logged in [Azure CLI](https://github.com/azure/azure-cli): `AzureCliCredentials` | ||
|
||
### azure-android-client-authentication (beta) | ||
This package provides access to Active Directory authentication on Android. You can login with Microsoft accounts, OrgId, with or without multi-factor auth. | ||
|
||
## Build | ||
To build this repository, you will need maven 2.0+ and gradle 1.6+. | ||
|
||
## Contributing | ||
This repository is for runtime & authentication specifically. For issues in the generated code, please report in [AutoRest](https://github.com/Azure/autorest). For bugs in the Azure SDK, please report in [Azure SDK for Java](https://github.com/Azure/azure-sdk-for-java). If you are unsure, please file here and state that clearly in the issue. Pull requests are welcomed with clear Javadocs. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
buildscript { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We aren't using gradle to build so we should convert to maven projects during the clean-up. |
||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.3.0' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'maven' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.1" | ||
|
||
defaultConfig { | ||
minSdkVersion 15 | ||
targetSdkVersion 23 | ||
versionCode 1 | ||
versionName "1.0.0-beta6-SNAPSHOT" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_7 | ||
targetCompatibility JavaVersion.VERSION_1_7 | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
configurations { | ||
deployerJars | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile 'com.android.support:appcompat-v7:23.0.1' | ||
compile 'com.microsoft.aad:adal:1.1.11' | ||
compile 'com.microsoft.azure:azure-client-runtime:1.0.0-beta2' | ||
testCompile 'junit:junit:4.12' | ||
testCompile 'junit:junit-dep:4.11' | ||
deployerJars "org.apache.maven.wagon:wagon-ftp:2.10" | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
configuration = configurations.deployerJars | ||
snapshotRepository(url: "ftp://waws-prod-bay-005.ftp.azurewebsites.windows.net/site/wwwroot/") { | ||
authentication(userName: username, password: password) | ||
} | ||
repository(url: "file://$buildDir/repository") | ||
pom.setArtifactId "azure-android-client-authentication" | ||
pom.project { | ||
name 'Microsoft Azure AutoRest Authentication Library for Java' | ||
description 'This is the authentication library for AutoRest generated Azure Java clients.' | ||
url 'https://github.com/Azure/autorest' | ||
|
||
scm { | ||
url 'scm:git:https://github.com/Azure/AutoRest' | ||
connection 'scm:git:git://github.com/Azure/AutoRest.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'The MIT License (MIT)' | ||
url 'http://opensource.org/licenses/MIT' | ||
distribution 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'microsoft' | ||
name 'Microsoft' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
from android.sourceSets.main.java.srcDirs | ||
classifier = 'sources' | ||
} | ||
|
||
task javadoc(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: [javadoc]) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
archives javadocJar | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
username = fake | ||
password = fake |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Wed Nov 11 13:21:00 PST 2015 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be removed during clean-up.