Skip to content

Commit

Permalink
Migrate to Angular Application builder
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin-boehm committed Feb 26, 2024
1 parent 899cf36 commit ed9723b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"prefix": "jhi",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser-esbuild",
"builder": "@angular-devkit/build-angular:application",
"options": {
"allowedCommonJsDependencies": ["sockjs-client", "webstomp-client"],
"outputPath": "build/resources/main/static/",
"index": "src/main/webapp/index.html",
"main": "src/main/webapp/main.ts",
"browser": "src/main/webapp/main.ts",
"polyfills": ["./src/main/webapp/sockjs-client.polyfill", "zone.js"],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
Expand All @@ -43,8 +43,7 @@
"sourceMap": false,
"namedChunks": true,
"extractLicenses": true,
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json",
"serviceWorker": "ngsw-config.json",
"budgets": [
{
"type": "initial",
Expand Down
2 changes: 1 addition & 1 deletion gradle/profile_dev.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ task webapp(type: NpmTask) {
inputs.dir("src/main/webapp/")
.withPropertyName("webapp-source-dir")
.withPathSensitivity(PathSensitivity.RELATIVE)
outputs.dir("build/resources/main/static/")
outputs.dir("build/resources/main/static/browser/")
.withPropertyName("webapp-build-dir")

dependsOn npmInstall
Expand Down
2 changes: 1 addition & 1 deletion gradle/war.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bootWar {
}

war {
webAppDirName = "build/resources/main/static/"
webAppDirName = "build/resources/main/static/browser/"
webXml = file("${project.rootDir}/src/main/webapp/WEB-INF/web.xml")
enabled = true
archiveExtension = "war.original"
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/tum/cit/ase/config/WebConfigurer.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void setLocationForStaticAssets(WebServerFactory server) {
if (server instanceof ConfigurableServletWebServerFactory servletWebServer) {
File root;
String prefixPath = resolvePathPrefix();
root = new File(prefixPath + "build/resources/main/static/");
root = new File(prefixPath + "build/resources/main/static/browser/");
if (root.exists() && root.isDirectory()) {
servletWebServer.setDocumentRoot(root);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/de/tum/cit/ase/config/WebConfigurerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void shouldCustomizeServletContainer() {
assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html");
assertThat(container.getMimeMappings().get("json")).isEqualTo("application/json");
if (container.getDocumentRoot() != null) {
assertThat(container.getDocumentRoot()).isEqualTo(new File("build/resources/main/static/"));
assertThat(container.getDocumentRoot()).isEqualTo(new File("build/resources/main/static/browser/"));
}
}

Expand Down

0 comments on commit ed9723b

Please sign in to comment.