Skip to content
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

chore: add packages' static components from templates #555

Merged
merged 4 commits into from
Dec 17, 2019

Conversation

AllanZhengYP
Copy link
Contributor

@AllanZhengYP AllanZhengYP commented Dec 13, 2019

Generate LICENSE, .gitignore, .npmignore, tsconfig.*.json, READEME.md in the AWS client codegen. Once generated for the first time, these files would be overwritten by codegen again. These entities will be maintained in-place instead of codegen.

Related: smithy-lang/smithy-typescript#56

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mtdowling
Copy link
Member

I think the static files and copying them over into code generated clients should happen in the Java codegen.

@AllanZhengYP
Copy link
Contributor Author

@mtdowling moved static files generation to the code gen.

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

) {
writerFactory.accept(".gitignore", writer -> {
String resource = IoUtils.readUtf8Resource(
getClass().getClassLoader(), "software/amazon/smithy/aws/typescript/codegen/gitignore");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to just say "gitignore" and leave out the rest of the path

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

import software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;
import software.amazon.smithy.utils.IoUtils;

public class AwsPackageFixturesGeneratorIntegration implements TypeScriptIntegration {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: make this final

});
writerFactory.accept("README.md", writer -> {
String resource = IoUtils.readUtf8Resource(getClass(), "README.md.template");
resource = resource.replaceAll("\\$\\{packageName\\}", settings.getPackageName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "\\$\\{packageName\\}" could be replaced with Pattern.quote("${packageName}") to make it more readable.

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

import software.amazon.smithy.model.node.Node;
import software.amazon.smithy.typescript.codegen.TypeScriptCodegenPlugin;

public class AwsPackageFixturesGeneratorIntegrationTest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet!

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@AllanZhengYP AllanZhengYP merged commit 0346ec6 into aws:smithy-codegen Dec 17, 2019
@lock
Copy link

lock bot commented Dec 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants