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>
|
||||
<groupId>com.extendedclip.papi.expansion.javascript</groupId>
|
||||
<artifactId>javascript-expansion</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<version>1.3.1</version>
|
||||
<name>PAPI-Expansion-Javascript</name>
|
||||
<description>PlaceholderAPI expansion for javascript placeholders</description>
|
||||
|
||||
@ -40,6 +40,12 @@
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<finalName>${name}</finalName>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -56,4 +62,5 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
@ -47,9 +47,12 @@ public class JavascriptExpansion extends PlaceholderExpansion implements Cacheab
|
||||
|
||||
private final Set<JavascriptPlaceholder> scripts = new HashSet<JavascriptPlaceholder>();
|
||||
|
||||
private final String VERSION = getClass().getPackage().getImplementationVersion();
|
||||
|
||||
@Override
|
||||
public boolean register() {
|
||||
|
||||
|
||||
engineType = getString("engine", "javascript");
|
||||
|
||||
if (engine == null) {
|
||||
@ -128,7 +131,7 @@ public class JavascriptExpansion extends PlaceholderExpansion implements Cacheab
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "1.3.0";
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
public boolean addJavascriptPlaceholder(JavascriptPlaceholder p) {
|
||||
|
@ -38,7 +38,6 @@ public class JavascriptPlaceholder {
|
||||
|
||||
private String falseResult;
|
||||
|
||||
|
||||
private JavascriptReturnType type;
|
||||
|
||||
public JavascriptPlaceholder(String identifier, JavascriptReturnType type, String expression, String trueResult, String falseResult) {
|
||||
|
@ -292,10 +292,21 @@ public class JavascriptPlaceholdersConfig {
|
||||
|
||||
String line = scanner.nextLine();
|
||||
|
||||
if (line == null || line.isEmpty() || line.startsWith("//")) {
|
||||
if (line == null || line.isEmpty()) {
|
||||
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 + " ");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user