From a5c0290cfa3149894f032d4940a3819accd53226 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sat, 12 Jul 2025 21:38:14 +0200 Subject: [PATCH] licenses stuff move to app/ --- .github/workflows/licenses-update.yml | 2 +- allowed-licenses.json => app/allowed-licenses.json | 0 app/core/.gitignore | 2 +- build.gradle | 3 ++- devGuide/DeveloperGuide.md | 14 +++++++------- 5 files changed, 11 insertions(+), 10 deletions(-) rename allowed-licenses.json => app/allowed-licenses.json (100%) diff --git a/.github/workflows/licenses-update.yml b/.github/workflows/licenses-update.yml index f08ef8ba0..ba66627ad 100644 --- a/.github/workflows/licenses-update.yml +++ b/.github/workflows/licenses-update.yml @@ -61,7 +61,7 @@ jobs: - name: Commit changes run: | - git add core/src/main/resources/static/3rdPartyLicenses.json + git add app/core/src/main/resources/static/3rdPartyLicenses.json git diff --staged --quiet || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV - name: Create Pull Request diff --git a/allowed-licenses.json b/app/allowed-licenses.json similarity index 100% rename from allowed-licenses.json rename to app/allowed-licenses.json diff --git a/app/core/.gitignore b/app/core/.gitignore index 138244dfe..f85be51d5 100644 --- a/app/core/.gitignore +++ b/app/core/.gitignore @@ -124,7 +124,7 @@ SwaggerDoc.json *.rar *.db /build/* -/core/build/* +/app/core/build/* # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/build.gradle b/build.gradle index 6a8feae31..21ca8bfe0 100644 --- a/build.gradle +++ b/build.gradle @@ -208,7 +208,8 @@ tasks.withType(JavaCompile).configureEach { licenseReport { renderers = [new JsonReportRenderer()] - allowedLicensesFile = new File("$projectDir/allowed-licenses.json") + allowedLicensesFile = project.layout.projectDirectory.file("app/allowed-licenses.json").asFile + outputDir = project.layout.buildDirectory.dir("reports/dependency-license").get().asFile.path } sourceSets { diff --git a/devGuide/DeveloperGuide.md b/devGuide/DeveloperGuide.md index 2e1f939bd..c37be9b84 100644 --- a/devGuide/DeveloperGuide.md +++ b/devGuide/DeveloperGuide.md @@ -332,7 +332,7 @@ Thymeleaf is a server-side Java HTML template engine. It is used in Stirling-PDF ### Thymeleaf overview -In Stirling-PDF, Thymeleaf is used to create HTML templates that are rendered on the server side. These templates are located in the `core/src/main/resources/templates` directory. Thymeleaf templates use a combination of HTML and special Thymeleaf attributes to dynamically generate content. +In Stirling-PDF, Thymeleaf is used to create HTML templates that are rendered on the server side. These templates are located in the `app/core/src/main/resources/templates` directory. Thymeleaf templates use a combination of HTML and special Thymeleaf attributes to dynamically generate content. Some examples of this are: @@ -384,7 +384,7 @@ This would generate n entries of tr for each person in exampleData ### Adding a New Feature to the Backend (API) 1. **Create a New Controller:** - - Create a new Java class in the `core/src/main/java/stirling/software/SPDF/controller/api` directory. + - Create a new Java class in the `app/core/src/main/java/stirling/software/SPDF/controller/api` directory. - Annotate the class with `@RestController` and `@RequestMapping` to define the API endpoint. - Ensure to add API documentation annotations like `@Tag(name = "General", description = "General APIs")` and `@Operation(summary = "Crops a PDF document", description = "This operation takes an input PDF file and crops it according to the given coordinates. Input:PDF Output:PDF Type:SISO")`. @@ -411,7 +411,7 @@ This would generate n entries of tr for each person in exampleData ``` 2. **Define the Service Layer:** (Not required but often useful) - - Create a new service class in the `core/src/main/java/stirling/software/SPDF/service` directory. + - Create a new service class in the `app/core/src/main/java/stirling/software/SPDF/service` directory. - Implement the business logic for the new feature. ```java @@ -463,7 +463,7 @@ This would generate n entries of tr for each person in exampleData ### Adding a New Feature to the Frontend (UI) 1. **Create a New Thymeleaf Template:** - - Create a new HTML file in the `core/src/main/resources/templates` directory. + - Create a new HTML file in the `app/core/src/main/resources/templates` directory. - Use Thymeleaf attributes to dynamically generate content. - Use `extract-page.html` as a base example for the HTML template, which is useful to ensure importing of the general layout, navbar, and footer. @@ -507,7 +507,7 @@ This would generate n entries of tr for each person in exampleData ``` 2. **Create a New Controller for the UI:** - - Create a new Java class in the `core/src/main/java/stirling/software/SPDF/controller/ui` directory. + - Create a new Java class in the `app/core/src/main/java/stirling/software/SPDF/controller/ui` directory. - Annotate the class with `@Controller` and `@RequestMapping` to define the UI endpoint. ```java @@ -537,7 +537,7 @@ This would generate n entries of tr for each person in exampleData 3. **Update the Navigation Bar:** - Add a link to the new feature page in the navigation bar. - - Update the `core/src/main/resources/templates/fragments/navbar.html` file. + - Update the `app/core/src/main/resources/templates/fragments/navbar.html` file. ```html