-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4148 from dsgouda/docs
Adding instructions to generate code and open a PR
- Loading branch information
Showing
1 changed file
with
44 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,44 @@ | ||
# How to generate Code | ||
|
||
To generate code, simply run the `generate.ps1` powershell script. If a powershell script does not exist under the RP directory, create one using an example [here](https://github.com/Azure/azure-sdk-for-net/blob/psSdkJson6/src/SDKs/Compute/Management.Compute/generate.ps1). | ||
|
||
If code generation fails for any reason, here a few common steps to resolve the issues. | ||
|
||
- Clean the repo | ||
``` | ||
git clean -xdf | ||
``` | ||
- Download and install the latest build tools (use a VS 2017 developer prompt to run msbuild) | ||
``` | ||
msbuild build.proj | ||
``` | ||
- Run the `generate.ps1` command again | ||
|
||
|
||
# When opening a PR | ||
|
||
## General instructions | ||
- Please link the REST spec API PR which helps the review process | ||
- Please check whether a new API version is introduced in the REST spec repo; this is important while addressing the instructions below | ||
- Please read the SLA information and other instructions on the PR template before opening the PR | ||
|
||
## REST API version artifacts | ||
If there is a new version of the REST API from which code is being generated for the PR, the following files should be modified/created in the PR | ||
- A `.props` file which holds information about the REST API versions eg: [here](https://github.com/Azure/azure-sdk-for-net/blob/psSdkJson6/src/SDKs/Compute/AzSdk.RP.props) | ||
- A `SdkInfo_*.cs` file which holds information about the REST API versions eg: [here](https://github.com/Azure/azure-sdk-for-net/blob/psSdkJson6/src/SDKs/Compute/AzSdk.RP.props) | ||
|
||
To generate the `.props` artifact, please run (use the VS 2017 developer prompt for msbuild): | ||
``` | ||
msbuild build.proj /t:build /p:Scope=SDKs\<RP> | ||
``` | ||
RP is the resource provider's directory under SDKs, eg.: Compute | ||
|
||
To generate the `SdkInfo*.cs` file, please run the `generate.ps1` script | ||
|
||
## Code generation artifacts | ||
If code is generated using `generate.ps1`, information related to the generation gets logged in a `.txt` file under `src\SDKs\_metadata` eg.: [here](https://github.com/Azure/azure-sdk-for-net/blob/psSdkJson6/src/SDKs/_metadata/compute_resource-manager.txt) | ||
|
||
Please check the branch and fork of the REST spec for which the code was generated, this must always be `Azure` and `master` respectively for a PR to be valid. Code generated using specifications not checked in the Azure master branch will not be merged. | ||
|
||
# How to sign/publish bits | ||
For detailed information about publishing and the overall workflow towards developing a powershell cli, click [here](https://github.com/Azure/adx-documentation-pr/blob/master/engineering/autorest-to-powershell.md) |