Skip to content

Commit

Permalink
Merge pull request #655 from Alfresco/fix/MNT_23888_reserved_keywords
Browse files Browse the repository at this point in the history
[MNT-23888] Changes done for handling reserved words while compressing the Javascript files.
  • Loading branch information
suneet-gupta authored Oct 19, 2023
2 parents 20d4486 + 013fed7 commit e63c849
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,51 +287,65 @@
</executions>
</plugin>

<!-- Compress JavaScript files and store as *-min.js -->
<!-- Compress JavaScript files and store as *.min.js -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<groupId>com.github.blutorange</groupId>
<artifactId>closure-compiler-maven-plugin</artifactId>
<version>2.28.0</version>
<executions>
<!-- Compress the JS files under the assembly folder -->
<execution>
<id>compress-assembly</id>
<phase>generate-resources</phase>
<goals>
<goal>compress</goal>
<goal>minify</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/assembly/web</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/assembly/web</outputDirectory>
<baseSourceDir>${project.basedir}/src/main/assembly</baseSourceDir>
<baseTargetDir>${project.basedir}/src/main/assembly</baseTargetDir>
<sourceDir>web</sourceDir>
<targetDir>web</targetDir>
<skipMerge>true</skipMerge>
<includes>
<include>**/*.js</include>
</includes>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/META-INF/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
<!-- Compress the JS files under the resources folder -->
<execution>
<id>compress-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>compress</goal>
<goal>minify</goal>
</goals>
<configuration>
<baseSourceDir>${project.basedir}/src/main</baseSourceDir>
<baseTargetDir>${project.basedir}/src/main</baseTargetDir>
<sourceDir>resources</sourceDir>
<targetDir>resources</targetDir>
<skipMerge>true</skipMerge>
<includes>
<include>**/*.js</include>
</includes>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,56 +355,69 @@
</dependencies>
</plugin>

<!-- Compress JavaScript files and store as *-min.js -->
<!-- Compress JavaScript files and store as *.min.js -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<groupId>com.github.blutorange</groupId>
<artifactId>closure-compiler-maven-plugin</artifactId>
<version>2.28.0</version>
<executions>
<!-- Compress the JS files under the assembly folder -->
<execution>
<id>compress-assembly</id>
<phase>generate-resources</phase>
<goals>
<goal>compress</goal>
<goal>minify</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/assembly/web</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/assembly/web</outputDirectory>
<baseSourceDir>${project.basedir}/src/main/assembly</baseSourceDir>
<baseTargetDir>${project.basedir}/src/main/assembly</baseTargetDir>
<sourceDir>web</sourceDir>
<targetDir>web</targetDir>
<skipMerge>true</skipMerge>
<includes>
<include>**/*.js</include>
</includes>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/META-INF/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
<!-- Compress the JS files under the resources folder -->
<execution>
<id>compress-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>compress</goal>
<goal>minify</goal>
</goals>
<configuration>
<baseSourceDir>${project.basedir}/src/main</baseSourceDir>
<baseTargetDir>${project.basedir}/src/main</baseTargetDir>
<sourceDir>resources</sourceDir>
<targetDir>resources</targetDir>
<skipMerge>true</skipMerge>
<includes>
<include>**/*.js</include>
</includes>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
</executions>
</plugin>

<!-- Hot reloading with JRebel -->
<plugin>
<groupId>org.zeroturnaround</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,51 +221,65 @@
</executions>
</plugin>

<!-- Compress JavaScript files and store as *-min.js -->
<!-- Compress JavaScript files and store as *.min.js -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<groupId>com.github.blutorange</groupId>
<artifactId>closure-compiler-maven-plugin</artifactId>
<version>2.28.0</version>
<executions>
<!-- Compress the JS files under the assembly folder -->
<execution>
<id>compress-assembly</id>
<phase>generate-resources</phase>
<goals>
<goal>compress</goal>
<goal>minify</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/assembly/web</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/assembly/web</outputDirectory>
<baseSourceDir>${project.basedir}/src/main/assembly</baseSourceDir>
<baseTargetDir>${project.basedir}/src/main/assembly</baseTargetDir>
<sourceDir>web</sourceDir>
<targetDir>web</targetDir>
<skipMerge>true</skipMerge>
<includes>
<include>**/*.js</include>
</includes>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/META-INF/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
<!-- Compress the JS files under the resources folder -->
<execution>
<id>compress-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>compress</goal>
<goal>minify</goal>
</goals>
<configuration>
<baseSourceDir>${project.basedir}/src/main</baseSourceDir>
<baseTargetDir>${project.basedir}/src/main</baseTargetDir>
<sourceDir>resources</sourceDir>
<targetDir>resources</targetDir>
<skipMerge>true</skipMerge>
<includes>
<include>**/*.js</include>
</includes>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit e63c849

Please sign in to comment.