mirror of
https://github.com/PlaceholderAPI/Javascript-Expansion.git
synced 2025-05-23 18:42:44 +00:00
Added pom versioning. Temp fix for single line comments in .js files
This commit is contained in:
parent
b496a3244e
commit
0be7ac50c6
9
pom.xml
9
pom.xml
@ -2,7 +2,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.extendedclip.papi.expansion.javascript</groupId>
|
<groupId>com.extendedclip.papi.expansion.javascript</groupId>
|
||||||
<artifactId>javascript-expansion</artifactId>
|
<artifactId>javascript-expansion</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>1.3.1</version>
|
||||||
<name>PAPI-Expansion-Javascript</name>
|
<name>PAPI-Expansion-Javascript</name>
|
||||||
<description>PlaceholderAPI expansion for javascript placeholders</description>
|
<description>PlaceholderAPI expansion for javascript placeholders</description>
|
||||||
|
|
||||||
@ -40,6 +40,12 @@
|
|||||||
<version>2.3.2</version>
|
<version>2.3.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${name}</finalName>
|
<finalName>${name}</finalName>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||||
|
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -55,5 +61,6 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -47,9 +47,12 @@ public class JavascriptExpansion extends PlaceholderExpansion implements Cacheab
|
|||||||
|
|
||||||
private final Set<JavascriptPlaceholder> scripts = new HashSet<JavascriptPlaceholder>();
|
private final Set<JavascriptPlaceholder> scripts = new HashSet<JavascriptPlaceholder>();
|
||||||
|
|
||||||
|
private final String VERSION = getClass().getPackage().getImplementationVersion();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean register() {
|
public boolean register() {
|
||||||
|
|
||||||
|
|
||||||
engineType = getString("engine", "javascript");
|
engineType = getString("engine", "javascript");
|
||||||
|
|
||||||
if (engine == null) {
|
if (engine == null) {
|
||||||
@ -128,7 +131,7 @@ public class JavascriptExpansion extends PlaceholderExpansion implements Cacheab
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return "1.3.0";
|
return VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean addJavascriptPlaceholder(JavascriptPlaceholder p) {
|
public boolean addJavascriptPlaceholder(JavascriptPlaceholder p) {
|
||||||
|
@ -38,7 +38,6 @@ public class JavascriptPlaceholder {
|
|||||||
|
|
||||||
private String falseResult;
|
private String falseResult;
|
||||||
|
|
||||||
|
|
||||||
private JavascriptReturnType type;
|
private JavascriptReturnType type;
|
||||||
|
|
||||||
public JavascriptPlaceholder(String identifier, JavascriptReturnType type, String expression, String trueResult, String falseResult) {
|
public JavascriptPlaceholder(String identifier, JavascriptReturnType type, String expression, String trueResult, String falseResult) {
|
||||||
|
@ -292,9 +292,20 @@ public class JavascriptPlaceholdersConfig {
|
|||||||
|
|
||||||
String line = scanner.nextLine();
|
String line = scanner.nextLine();
|
||||||
|
|
||||||
if (line == null || line.isEmpty() || line.startsWith("//")) {
|
if (line == null || line.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
line = line.trim();
|
||||||
|
|
||||||
|
/* temp fix for single line comments
|
||||||
|
* doesnt solve every case though..
|
||||||
|
* lines that start with code and may have a comment afterward still screw stuff up...
|
||||||
|
*/
|
||||||
|
if (line.startsWith("//")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sb.append(line + " ");
|
sb.append(line + " ");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user