forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add template for client package (Azure#2587)
- Loading branch information
1 parent
4a9dfb4
commit b4e30b6
Showing
8 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
parameters: | ||
name: '' | ||
vmImage: '' | ||
|
||
jobs: | ||
- job: ${{ format('Test_{0}', parameters.name) }} | ||
|
||
pool: | ||
vmImage: ${{ parameters.vmImage }} | ||
|
||
steps: | ||
- task: Maven@3 | ||
displayName: 'Run tests' | ||
inputs: | ||
mavenPomFile: 'pom.client.build.xml' | ||
options: '--batch-mode' #hides dependencies download progress from CI output | ||
mavenOptions: '-Xmx3072m -Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' | ||
javaHomeOption: 'JDKVersion' | ||
jdkVersionOption: '1.8' | ||
jdkArchitectureOption: 'x64' | ||
publishJUnitResults: true | ||
testResultsFiles: '**/TEST-*.xml' | ||
goals: 'test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
trigger: | ||
- master | ||
|
||
jobs: | ||
- template: client.test.yml | ||
parameters: | ||
name: Linux | ||
vmImage: 'ubuntu-16.04' | ||
|
||
- template: client.test.yml | ||
parameters: | ||
name: macOS | ||
vmImage: 'macOS-10.13' | ||
|
||
- template: client.test.yml | ||
parameters: | ||
name: Windows | ||
vmImage: 'vs2017-win2016' | ||
|
||
- job: 'Publish' | ||
|
||
dependsOn: | ||
- 'Test_Linux' | ||
- 'Test_macOS' | ||
- 'Test_Windows' | ||
|
||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
|
||
steps: | ||
- task: Maven@3 | ||
inputs: | ||
mavenPomFile: 'pom.client.build.xml' | ||
options: '--batch-mode' #hides dependencies download progress from CI output | ||
mavenOptions: '-Xmx3072m -Dmaven.test.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' | ||
javaHomeOption: 'JDKVersion' | ||
jdkVersionOption: '1.8' | ||
jdkArchitectureOption: 'x64' | ||
publishJUnitResults: false | ||
goals: 'package' | ||
displayName: 'Package' | ||
|
||
- task: CopyFiles@2 | ||
inputs: | ||
contents: '**/*.jar' | ||
targetFolder: $(Build.ArtifactStagingDirectory) | ||
flattenFolders: true | ||
displayName: 'Copy' | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-sdk-parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>./pom.client.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>azure-sdk-parent-build</artifactId> | ||
<version>${parent.version}</version> | ||
<packaging>pom</packaging> | ||
|
||
<name>Microsoft Azure SDK Build</name> | ||
<description>This package bundles all the SDKs in a multi-module for build/CI purposes.</description> | ||
<url>https://github.com/Azure/azure-sdk-for-java</url> | ||
|
||
<modules> | ||
<module>./template/client</module> | ||
</modules> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-sdk-parent</artifactId> | ||
<packaging>pom</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<name>Microsoft Azure SDK Parent</name> | ||
<description>This package contains the parent module of Microsoft Azure SDK.</description> | ||
<url>https://github.com/Azure/azure-sdk-for-java</url> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.1</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
<showWarnings>true</showWarnings> | ||
<showDeprecation>true</showDeprecation> | ||
<compilerArgument>-Xlint:unchecked</compilerArgument> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Azure Template | ||
|
||
This project provides a starter template for a Java client package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-sdk-parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../../pom.client.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>azure-sdk-template</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<name>Microsoft Azure SDK for Template</name> | ||
<description>This package contains Microsoft Azure SDK for Template.</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
12 changes: 12 additions & 0 deletions
12
template/client/src/main/java/com/microsoft/azure/template/Hello.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
*/ | ||
package com.microsoft.azure.template; | ||
|
||
public class Hello { | ||
public String getMessage() { | ||
return "hello"; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
template/client/src/test/java/com/microsoft/azure/template/HelloTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
*/ | ||
package com.microsoft.azure.template; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class HelloTest { | ||
@Test | ||
public void testMessage() { | ||
assertEquals("hello", (new Hello()).getMessage()); | ||
} | ||
} |