Skip to content

Commit

Permalink
mgmt, codegen related changes (#22770)
Browse files Browse the repository at this point in the history
* mgmt, codegen, add argument for additional autorest options

* update script

* update changelog gen to match new guide

* update codegen version
  • Loading branch information
weidongxu-microsoft authored Jul 5, 2021
1 parent af9f651 commit c8119b7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion eng/mgmt/automation/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def generate(
use: str,
tag: str = None,
version: str = None,
autorest_options: str = '',
**kwargs,
):
module = ARTIFACT_FORMAT.format(service)
Expand All @@ -62,7 +63,7 @@ def generate(
os.path.abspath(sdk_root),
os.path.abspath(output_dir),
namespace,
' '.join((tag_option, version_option, FLUENTLITE_ARGUMENTS, readme)),
' '.join((tag_option, version_option, FLUENTLITE_ARGUMENTS, autorest_options, readme)),
)
logging.info(command)
if os.system(command) != 0:
Expand Down Expand Up @@ -491,6 +492,11 @@ def parse_args() -> argparse.Namespace:
default = AUTOREST_CORE_VERSION,
help = 'Autorest version',
)
parser.add_argument(
'--autorest-options',
default = '',
help = 'Additional autorest options',
)
parser.add_argument('--suffix', help = 'Suffix for namespace and artifact')
parser.add_argument(
'--auto-commit-external-change',
Expand Down
2 changes: 1 addition & 1 deletion eng/mgmt/automation/generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ steps:
- bash: |
export PATH=$JAVA_HOME_11_X64/bin:$PATH
java -version
./eng/mgmt/automation/generate.py --readme "$(README)" --tag "$(TAG)" --service "$(SERVICE)" --version "$(VERSION)" --suffix "$(SUFFIX)" --auto-commit-external-change --user-name "azure-sdk" --user-email "[email protected]"
./eng/mgmt/automation/generate.py --readme "$(README)" --tag "$(TAG)" --autorest-options="$(AUTOREST_OPTIONS)" --service "$(SERVICE)" --version "$(VERSION)" --suffix "$(SUFFIX)" --auto-commit-external-change --user-name "azure-sdk" --user-email "[email protected]"
displayName: Generation

- template: /eng/common/pipelines/templates/steps/create-pull-request.yml
Expand Down
2 changes: 1 addition & 1 deletion eng/mgmt/automation/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

SDK_ROOT = '../../../' # related to file dir
AUTOREST_CORE_VERSION = '3.1.3'
AUTOREST_JAVA = '@autorest/[email protected].30'
AUTOREST_JAVA = '@autorest/[email protected].31'
DEFAULT_VERSION = '1.0.0-beta.1'
GROUP_ID = 'com.azure.resourcemanager'
API_SPECS_FILE = 'api-specs.yaml'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import java.util.stream.Stream;

public class Main {
private final static String BREAKING_CHANGE_TITLE = "### Breaking Change\n\n";
private final static String NEW_FEATURE_TITLE = "### New Feature\n\n";
private final static String BREAKING_CHANGE_TITLE = "### Breaking Changes\n\n";
private final static String NEW_FEATURE_TITLE = "### Features Added\n\n";

public static void main(String[] args) throws Exception {
String oldJar = System.getProperty("OLD_JAR");
Expand Down
2 changes: 1 addition & 1 deletion sdk/resourcemanager/tools/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def main():
current_changelog = left if left.strip() else '\n\n- Migrated from previous sdk\n'
else:
left = left[:second_version.start()]
current_changelog = left if left.strip() else '\n\n- Updated core dependency from resources\n'
current_changelog = left if left.strip() else '\n\n### Dependency Updates\n\n- Updated core dependency from resources\n'

version: str = first_version.group().replace(
first_version.group(2), str(date)).replace(
Expand Down

0 comments on commit c8119b7

Please sign in to comment.