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

fix(infrastructure): fix java compilation issue without api, and skip unused constructs in java/py #629

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ import software.constructs.Construct;
* Construct to deploy a Static Website
*/
public class WebsiteConstruct extends Construct {
public WebsiteConstruct(Construct scope, String id, UserIdentity userIdentity) {
this(scope, id, userIdentity{{^hasApi}}/* {{/hasApi}}, null{{^hasApi}} */{{/hasApi}});
}

public WebsiteConstruct(Construct scope, String id, UserIdentity userIdentity{{^hasApi}}/* {{/hasApi}}, ApiConstruct apiConstruct{{^hasApi}} */{{/hasApi}}) {
super(scope, id);
Expand All @@ -31,7 +28,8 @@ public class WebsiteConstruct extends Construct {
"identityPoolId", userIdentity.getIdentityPool().getIdentityPoolId(),
"userPoolId", userIdentity.getUserPool().getUserPoolId(),
"userPoolWebClientId", userIdentity.getUserPoolClient().getUserPoolClientId(){{#hasApi}},{{/hasApi}}
{{^hasApi}}// {{/hasApi}}"apiUrl", apiConstruct.api.getApi().urlForPath())))
{{^hasApi}}// {{/hasApi}}"apiUrl", apiConstruct.api.getApi().urlForPath()
)))
.build())
.distributionProps(DistributionProps.builder()
.geoRestriction(GeoRestriction.allowlist(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,16 @@ export class InfrastructureJavaProject extends AwsCdkJavaApp {
) {
fs.readdirSync(dir, { withFileTypes: true })
.filter((f) => {
let shouldIncludeFile = true;
if (!mustacheConfig.hasApi) {
return !f.name.endsWith("api.ts.mustache");
} else if (!mustacheConfig.hasWebsite) {
return !f.name.endsWith("website.ts.mustache");
} else {
return true;
shouldIncludeFile &&= !f.name.endsWith("ApiConstruct.java.mustache");
}
if (!mustacheConfig.hasWebsite) {
shouldIncludeFile &&= !f.name.endsWith(
"WebsiteConstruct.java.mustache"
);
}
return shouldIncludeFile;
})
.forEach((f) => {
if (f.isDirectory()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,14 @@ export class InfrastructurePyProject extends AwsCdkPythonApp {
) {
fs.readdirSync(dir, { withFileTypes: true })
.filter((f) => {
let shouldIncludeFile = true;
if (!mustacheConfig.hasApi) {
return !f.name.endsWith("api.ts.mustache");
} else if (!mustacheConfig.hasWebsite) {
return !f.name.endsWith("website.ts.mustache");
} else {
return true;
shouldIncludeFile &&= !f.name.endsWith("api.py.mustache");
}
if (!mustacheConfig.hasWebsite) {
shouldIncludeFile &&= !f.name.endsWith("website.py.mustache");
}
return shouldIncludeFile;
})
.forEach((f) => {
if (f.isDirectory()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ export class InfrastructureTsProject extends AwsCdkTypeScriptApp {
) {
fs.readdirSync(dir, { withFileTypes: true })
.filter((f) => {
let shouldIncludeFile = true;
if (!mustacheConfig.hasApi) {
return !f.name.endsWith("api.ts.mustache");
} else if (!mustacheConfig.hasWebsite) {
return !f.name.endsWith("website.ts.mustache");
} else {
return true;
shouldIncludeFile &&= !f.name.endsWith("api.ts.mustache");
}
if (!mustacheConfig.hasWebsite) {
shouldIncludeFile &&= !f.name.endsWith("website.ts.mustache");
}
return shouldIncludeFile;
})
.forEach((f) =>
f.isDirectory()
Expand Down
1 change: 0 additions & 1 deletion packages/infrastructure/test/.gitkeep

This file was deleted.

Loading
Loading