Skip to content
Open
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
2 changes: 2 additions & 0 deletions minify-html-java/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = false
46 changes: 38 additions & 8 deletions minify-html-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,51 @@
</distributionManagement>

<properties>
<java.version>1.7</java.version>
<java.version>1.8</java.version>
<junit.version>5.9.3</junit.version>
<lombok.version>1.18.38</lombok.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -79,7 +103,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.6.3</version>
<configuration>
<source>${java.version}</source>
</configuration>
Expand All @@ -93,10 +117,16 @@
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>3.2.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -111,7 +141,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.6.14</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down
180 changes: 28 additions & 152 deletions minify-html-java/src/main/java/in/wilsonl/minifyhtml/Configuration.java
Original file line number Diff line number Diff line change
@@ -1,160 +1,36 @@
package in.wilsonl.minifyhtml;

// WARNING: Do not manually edit, use Configuration.java.gen.js.
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Value;

/**
* Class representing minification configuration.
* Class representing minification configuration. Use the {@link Builder} to create an instance of
* this class.
*/
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder(setterPrefix = "set", builderClassName = "Builder")
@Value
public class Configuration {
public final boolean allow_noncompliant_unquoted_attribute_values;
public final boolean allow_optimal_entities;
public final boolean allow_removing_spaces_between_attributes;
public final boolean keep_closing_tags;
public final boolean keep_comments;
public final boolean keep_html_and_head_opening_tags;
public final boolean keep_input_type_text_attr;
public final boolean keep_ssi_comments;
public final boolean minify_css;
public final boolean minify_doctype;
public final boolean minify_js;
public final boolean preserve_brace_template_syntax;
public final boolean preserve_chevron_percent_template_syntax;
public final boolean remove_bangs;
public final boolean remove_processing_instructions;
// Do not change fields below or remove the markers.
// Use `update-java.sh` to generate config fields. Lombok takes care of the rest

private Configuration(
boolean allow_noncompliant_unquoted_attribute_values,
boolean allow_optimal_entities,
boolean allow_removing_spaces_between_attributes,
boolean keep_closing_tags,
boolean keep_comments,
boolean keep_html_and_head_opening_tags,
boolean keep_input_type_text_attr,
boolean keep_ssi_comments,
boolean minify_css,
boolean minify_doctype,
boolean minify_js,
boolean preserve_brace_template_syntax,
boolean preserve_chevron_percent_template_syntax,
boolean remove_bangs,
boolean remove_processing_instructions
) {
this.allow_noncompliant_unquoted_attribute_values = allow_noncompliant_unquoted_attribute_values;
this.allow_optimal_entities = allow_optimal_entities;
this.allow_removing_spaces_between_attributes = allow_removing_spaces_between_attributes;
this.keep_closing_tags = keep_closing_tags;
this.keep_comments = keep_comments;
this.keep_html_and_head_opening_tags = keep_html_and_head_opening_tags;
this.keep_input_type_text_attr = keep_input_type_text_attr;
this.keep_ssi_comments = keep_ssi_comments;
this.minify_css = minify_css;
this.minify_doctype = minify_doctype;
this.minify_js = minify_js;
this.preserve_brace_template_syntax = preserve_brace_template_syntax;
this.preserve_chevron_percent_template_syntax = preserve_chevron_percent_template_syntax;
this.remove_bangs = remove_bangs;
this.remove_processing_instructions = remove_processing_instructions;
}

/**
* Builder to help create configuration.
*/
public static class Builder {
private boolean allow_noncompliant_unquoted_attribute_values = false;
private boolean allow_optimal_entities = false;
private boolean allow_removing_spaces_between_attributes = false;
private boolean keep_closing_tags = false;
private boolean keep_comments = false;
private boolean keep_html_and_head_opening_tags = false;
private boolean keep_input_type_text_attr = false;
private boolean keep_ssi_comments = false;
private boolean minify_css = false;
private boolean minify_doctype = false;
private boolean minify_js = false;
private boolean preserve_brace_template_syntax = false;
private boolean preserve_chevron_percent_template_syntax = false;
private boolean remove_bangs = false;
private boolean remove_processing_instructions = false;

public Builder setAllowNoncompliantUnquotedAttributeValues(boolean v) {
this.allow_noncompliant_unquoted_attribute_values = v;
return this;
}
public Builder setAllowOptimalEntities(boolean v) {
this.allow_optimal_entities = v;
return this;
}
public Builder setAllowRemovingSpacesBetweenAttributes(boolean v) {
this.allow_removing_spaces_between_attributes = v;
return this;
}
public Builder setKeepClosingTags(boolean v) {
this.keep_closing_tags = v;
return this;
}
public Builder setKeepComments(boolean v) {
this.keep_comments = v;
return this;
}
public Builder setKeepHtmlAndHeadOpeningTags(boolean v) {
this.keep_html_and_head_opening_tags = v;
return this;
}
public Builder setKeepInputTypeTextAttr(boolean v) {
this.keep_input_type_text_attr = v;
return this;
}
public Builder setKeepSsiComments(boolean v) {
this.keep_ssi_comments = v;
return this;
}
public Builder setMinifyCss(boolean v) {
this.minify_css = v;
return this;
}
public Builder setMinifyDoctype(boolean v) {
this.minify_doctype = v;
return this;
}
public Builder setMinifyJs(boolean v) {
this.minify_js = v;
return this;
}
public Builder setPreserveBraceTemplateSyntax(boolean v) {
this.preserve_brace_template_syntax = v;
return this;
}
public Builder setPreserveChevronPercentTemplateSyntax(boolean v) {
this.preserve_chevron_percent_template_syntax = v;
return this;
}
public Builder setRemoveBangs(boolean v) {
this.remove_bangs = v;
return this;
}
public Builder setRemoveProcessingInstructions(boolean v) {
this.remove_processing_instructions = v;
return this;
}

public Configuration build() {
return new Configuration(
this.allow_noncompliant_unquoted_attribute_values,
this.allow_optimal_entities,
this.allow_removing_spaces_between_attributes,
this.keep_closing_tags,
this.keep_comments,
this.keep_html_and_head_opening_tags,
this.keep_input_type_text_attr,
this.keep_ssi_comments,
this.minify_css,
this.minify_doctype,
this.minify_js,
this.preserve_brace_template_syntax,
this.preserve_chevron_percent_template_syntax,
this.remove_bangs,
this.remove_processing_instructions
);
}
}
/* BEGIN FIELD NAMES */
boolean allowNoncompliantUnquotedAttributeValues;
boolean allowOptimalEntities;
boolean allowRemovingSpacesBetweenAttributes;
boolean keepClosingTags;
boolean keepComments;
boolean keepHtmlAndHeadOpeningTags;
boolean keepInputTypeTextAttr;
boolean keepSsiComments;
boolean minifyCss;
boolean minifyDoctype;
boolean minifyJs;
boolean preserveBraceTemplateSyntax;
boolean preserveChevronPercentTemplateSyntax;
boolean removeBangs;
boolean removeProcessingInstructions;
/* END FIELD NAMES */
}

This file was deleted.

Loading