From 6c1020d6424816587bce6b56eb39ea0343179eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A1udio=20Gomes?= Date: Tue, 12 Mar 2024 17:19:46 -0300 Subject: [PATCH] move resources --- .../pirilampo/core/compilers/Compiler.java | 2 +- .../core/compilers/FeatureToHTMLCompiler.java | 2 +- .../core/compilers/FeatureToPDFCompiler.java | 4 +-- .../core/compilers/FolderToHTMLCompiler.java | 10 +++--- .../core/compilers/FolderToPDFCompiler.java | 4 +-- .../clagomess/pirilampo/core}/.gitignore | 0 .../github/clagomess/pirilampo/core}/build.sh | 0 .../pirilampo/core}/css/feature-base.css | 0 .../pirilampo/core}/css/simple-sidebar.css | 0 .../core}/css/template-feature-pasta.css | 0 .../core}/css/template-feature-pdf.css | 0 .../pirilampo/core}/css/template-feature.css | 0 .../core}/dist/feature-pasta-angular.min.js | 0 .../core}/dist/feature-pasta.min.css | 0 .../pirilampo/core}/dist/feature-pasta.min.js | 0 .../pirilampo/core}/dist/feature-pdf.min.css | 0 .../pirilampo/core}/dist/feature.min.css | 0 .../clagomess/pirilampo/core}/gulpfile.js | 0 ...emplate-feature-pasta-content-wrapper.html | 0 .../html/template-feature-pasta-footer.html | 0 .../clagomess/pirilampo/core}/js/app.js | 0 .../pirilampo/core}/js/featureController.js | 0 .../core}/js/template-feature-pasta.js | 0 .../pirilampo/core}/package-lock.json | 0 .../clagomess/pirilampo/core}/package.json | 0 .../clagomess/pirilampo/core/Common.java | 25 ++++++------- .../core/compilers/CompilerTest.java | 34 ++++++++---------- .../compilers/FolderToHTMLCompilerTest.java | 6 ++-- .../pirilampo/core/dto/ParametersDtoTest.java | 16 ++++----- .../pirilampo/core/parsers/PdfParserTest.java | 5 +-- .../pirilampo/core}/feature/html_embed.html | 0 .../pirilampo/core}/feature/smallest.png | Bin .../pirilampo/core}/feature/xxx.Feature | 0 .../clagomess/pirilampo/core}/feature/xxx.png | Bin .../pirilampo/core}/feature_error/yyy.feature | 0 .../clagomess/pirilampo/core}/logo_xxx.png | Bin .../pirilampo/core}/master/xxx.Feature | 0 37 files changed, 49 insertions(+), 59 deletions(-) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/.gitignore (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/build.sh (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/css/feature-base.css (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/css/simple-sidebar.css (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/css/template-feature-pasta.css (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/css/template-feature-pdf.css (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/css/template-feature.css (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/dist/feature-pasta-angular.min.js (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/dist/feature-pasta.min.css (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/dist/feature-pasta.min.js (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/dist/feature-pdf.min.css (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/dist/feature.min.css (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/gulpfile.js (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/html/template-feature-pasta-content-wrapper.html (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/html/template-feature-pasta-footer.html (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/js/app.js (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/js/featureController.js (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/js/template-feature-pasta.js (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/package-lock.json (100%) rename core/src/main/resources/{htmlTemplate => com/github/clagomess/pirilampo/core}/package.json (100%) rename core/src/test/resources/{ => com/github/clagomess/pirilampo/core}/feature/html_embed.html (100%) rename core/src/test/resources/{ => com/github/clagomess/pirilampo/core}/feature/smallest.png (100%) rename core/src/test/resources/{ => com/github/clagomess/pirilampo/core}/feature/xxx.Feature (100%) rename core/src/test/resources/{ => com/github/clagomess/pirilampo/core}/feature/xxx.png (100%) rename core/src/test/resources/{ => com/github/clagomess/pirilampo/core}/feature_error/yyy.feature (100%) rename core/src/test/resources/{ => com/github/clagomess/pirilampo/core}/logo_xxx.png (100%) rename core/src/test/resources/{ => com/github/clagomess/pirilampo/core}/master/xxx.Feature (100%) diff --git a/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/Compiler.java b/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/Compiler.java index 5394eaf..580099e 100644 --- a/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/Compiler.java +++ b/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/Compiler.java @@ -110,7 +110,7 @@ protected File getOutArtifact(ParametersDto parameters){ } protected void writeResourceToOut(String resource, PrintWriter out) throws IOException { - URL url = Thread.currentThread().getContextClassLoader().getResource(resource); + URL url = getClass().getResource(resource); if(url == null){ throw new FileNotFoundException(String.format( "Resource %s not loaded", diff --git a/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FeatureToHTMLCompiler.java b/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FeatureToHTMLCompiler.java index 6a24532..bd13689 100644 --- a/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FeatureToHTMLCompiler.java +++ b/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FeatureToHTMLCompiler.java @@ -45,7 +45,7 @@ public void build() throws Exception { out.print(""); out.print(String.format("%s", parameters.getProjectName())); out.print(""); out.print(""); out.print("
"); diff --git a/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FeatureToPDFCompiler.java b/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FeatureToPDFCompiler.java index 159ed5f..f0d3bcc 100644 --- a/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FeatureToPDFCompiler.java +++ b/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FeatureToPDFCompiler.java @@ -42,8 +42,8 @@ public void build() throws Exception { try ( FileOutputStream fosPDF = new FileOutputStream(outArtifact); - InputStream css = Objects.requireNonNull(Thread.currentThread().getContextClassLoader() - .getResource("htmlTemplate/dist/feature-pdf.min.css")) + InputStream css = Objects.requireNonNull(getClass() + .getResource("../dist/feature-pdf.min.css")) .openStream(); ){ parameters.setEmbedImages(false); diff --git a/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FolderToHTMLCompiler.java b/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FolderToHTMLCompiler.java index 64f31d1..0f615c0 100644 --- a/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FolderToHTMLCompiler.java +++ b/core/src/main/java/com/github/clagomess/pirilampo/core/compilers/FolderToHTMLCompiler.java @@ -165,7 +165,7 @@ public void build() throws Exception { out.print(""); out.print(String.format("%s", parameters.getProjectName())); out.print("