-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into convertSearchWorker
* upstream/master: fixes remaining issues in #4844 (#4950) Fix threading issue with opening from recent libraries (#4943) New translations JabRef_en.properties (German) (#4946) New Crowdin translations (#4945) New Crowdin translations (#4944) Extract build plugins (#4934)
- Loading branch information
Showing
37 changed files
with
1,092 additions
and
4,171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
buildSrc/src/main/groovy/org/jabref/build/antlr/Antlr3CommandLine.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.jabref.build.antlr | ||
|
||
import org.gradle.api.file.FileCollection | ||
|
||
class Antlr3CommandLine implements AntlrCommandLine { | ||
|
||
private final task | ||
|
||
Antlr3CommandLine(AntlrTask task) { | ||
this.task = task | ||
} | ||
|
||
@Override | ||
String getMain() { | ||
return "org.antlr.Tool" | ||
} | ||
|
||
@Override | ||
FileCollection getClasspath() { | ||
return task.project.configurations.antlr3 | ||
} | ||
|
||
@Override | ||
List<String> getArguments() { | ||
return ["-o", task.project.file(task.outputDir).toString(), task.project.file(task.inputFile).toString()] | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
buildSrc/src/main/groovy/org/jabref/build/antlr/Antlr4CommandLine.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.jabref.build.antlr | ||
|
||
import org.gradle.api.file.FileCollection | ||
|
||
class Antlr4CommandLine implements AntlrCommandLine { | ||
|
||
private final AntlrTask task | ||
|
||
Antlr4CommandLine(AntlrTask task) { | ||
this.task = task | ||
} | ||
|
||
@Override | ||
String getMain() { | ||
return "org.antlr.v4.Tool" | ||
} | ||
|
||
@Override | ||
FileCollection getClasspath() { | ||
return task.project.configurations.antlr4 | ||
} | ||
|
||
@Override | ||
List<String> getArguments() { | ||
return ["-o", file(task.outputDir), "-visitor", "-no-listener", "-package", task.javaPackage, file(task.inputFile)] | ||
} | ||
|
||
private String file(String path) { | ||
return task.project.file(path).toString() | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrCommandLine.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.jabref.build.antlr | ||
|
||
import org.gradle.api.file.FileCollection | ||
|
||
/** | ||
* Encapsulates a command line call to an version of the ANTLR tools. | ||
*/ | ||
interface AntlrCommandLine { | ||
|
||
String getMain() | ||
|
||
FileCollection getClasspath() | ||
|
||
List<String> getArguments() | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrPlugin.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.jabref.build.antlr | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
/** | ||
* Configures the project for use with ANTLR 3 or 4. | ||
*/ | ||
class AntlrPlugin implements Plugin<Project> { | ||
|
||
public static final def ANTLR3_CONFIGURATION_NAME = "antlr3" | ||
public static final def ANTLR4_CONFIGURATION_NAME = "antlr4" | ||
|
||
@Override | ||
void apply(Project target) { | ||
def antlr3Cfg = target.configurations.create(ANTLR3_CONFIGURATION_NAME) | ||
antlr3Cfg.description = "Dependencies required to run the ANTLR3 tool." | ||
|
||
def antlr4Cfg = target.configurations.create(ANTLR4_CONFIGURATION_NAME) | ||
antlr4Cfg.description = "Dependencies required to run the ANTLR4 tool." | ||
} | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
buildSrc/src/main/groovy/org/jabref/build/antlr/AntlrTask.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package org.jabref.build.antlr | ||
|
||
import org.gradle.api.tasks.JavaExec | ||
import org.gradle.api.tasks.TaskAction | ||
|
||
class AntlrTask extends JavaExec { | ||
|
||
static def ANTLR3 = Antlr3CommandLine | ||
static def ANTLR4 = Antlr4CommandLine | ||
|
||
private Class<? extends AntlrCommandLine> antlr = ANTLR3 | ||
private String inputFile = "" | ||
private String outputDir = "" | ||
private String javaPackage = "" | ||
|
||
public AntlrTask() { | ||
project.configurations { | ||
antlr3 | ||
antlr4 | ||
} | ||
} | ||
|
||
@TaskAction | ||
@Override | ||
void exec() { | ||
AntlrCommandLine commandLine = antlr.newInstance(this) | ||
|
||
main = commandLine.main | ||
classpath = commandLine.classpath | ||
args = commandLine.arguments | ||
|
||
super.exec() | ||
} | ||
|
||
Class<? extends AntlrCommandLine> getAntlr() { | ||
return antlr | ||
} | ||
|
||
void setAntlr(Class<? extends AntlrCommandLine> antlr) { | ||
this.antlr = antlr | ||
} | ||
|
||
String getInputFile() { | ||
return inputFile | ||
} | ||
|
||
void setInputFile(String inputFile) { | ||
this.inputFile = inputFile | ||
inputs.file(inputFile) | ||
} | ||
|
||
String getOutputDir() { | ||
return outputDir | ||
} | ||
|
||
void setOutputDir(String outputDir) { | ||
this.outputDir = outputDir | ||
outputs.dir(outputDir) | ||
} | ||
|
||
String getJavaPackage() { | ||
return javaPackage | ||
} | ||
|
||
void setJavaPackage(String javaPackage) { | ||
this.javaPackage = javaPackage | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
buildSrc/src/main/groovy/org/jabref/build/localization/JythonTask.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.jabref.build.localization | ||
|
||
import org.gradle.api.tasks.JavaExec | ||
import org.gradle.api.tasks.TaskAction | ||
|
||
class JythonTask extends JavaExec { | ||
|
||
|
||
public static final String JYTHON_MAIN = 'org.python.util.jython' | ||
|
||
@TaskAction | ||
@Override | ||
void exec() { | ||
main JYTHON_MAIN | ||
classpath project.configurations.getByName(LocalizationPlugin.CONFIGURATION_NAME).asPath | ||
|
||
super.exec() | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
buildSrc/src/main/groovy/org/jabref/build/localization/LocalizationExtension.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.jabref.build.localization | ||
|
||
class LocalizationExtension { | ||
|
||
def script | ||
|
||
} |
Oops, something went wrong.