Prepare multi module build#3913
Conversation
- FreeCite does not generate a non-used BibtexKeyGenerator anymore - Introduce ExporterFactoryFactory - Introduce SavePreferenceFactory
# Conflicts: # src/main/java/org/jabref/preferences/JabRefPreferences.java
# Conflicts: # src/main/java/org/jabref/JabRefMain.java # src/main/java/org/jabref/gui/BasePanel.java
# Conflicts: # src/main/java/org/jabref/gui/BasePanel.java # src/main/java/org/jabref/preferences/SavePreferencesFactory.java
tobiasdiez
left a comment
There was a problem hiding this comment.
I've only very minor remarks and the code looks good. The OO stuff has to work obviously before merge.
| Reader reader; | ||
| // Try loading as a resource first. This works for files inside the JAR: | ||
| URL reso = JabRefMain.class.getResource(name); | ||
| URL reso = TemplateExporter.class.getResource(name); |
There was a problem hiding this comment.
Now name needs to be relative to org/jabref/logic/exporter/ and not org/jabref/ right?
There was a problem hiding this comment.
Sorry, but I don't really get what you want to say. You tested it and it worked although the changed code was never invoked?
jabref/src/main/java/org/jabref/logic/exporter/TemplateExporter.java
Lines 161 to 171 in 7844fcb
Gives a name of the form
/resource/layout/<exporter name>.layout. With the above change, I suspect that all layout files in src/main/resources/resource/layout are no longer found and thus the corresponding exporter stop to work.
There was a problem hiding this comment.
TL;DR: The given name is absolute, so it does not matter which class is used.
Longer reasoning (with debugging JabRef):
JabRefs main class is in org.jabref, so the path changes from
file:/C:/git-repositories/jabref/jabref/out/production/resources/resource/layout/html.begin.layout
to
file:/C:/git-repositories/jabref/jabref/out/production/resources/resource/layout/html.begin.layout
So, no change when debugging JabRef.
I think, it is because the parameter directory is given and thus the path is an absolute one. (Source: https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getResource(java.lang.String))
I would like to change the path to enable the test files residing in the test resources folder of "TemplateExporter".
There was a problem hiding this comment.
Ok, if it works then the change is of course fine with me. I was only concerned that the exporter may break.
|
|
||
| public class ExporterFactoryFactory { | ||
|
|
||
| public static ExporterFactory create(JabRefPreferences preferences, JournalAbbreviationLoader abbreviationLoader) { |
There was a problem hiding this comment.
What about moving this method to JabRefPreferences as an instance method createExportFactory(abbrLoader)?
| isKeywordSyncEnabled()); | ||
| } | ||
|
|
||
| public static SavePreferences loadForExportFromPreferences(JabRefPreferences preferences) { |
There was a problem hiding this comment.
Convert these two methods to instance methods and rename them to something like loadSavePreferencesForExport
There was a problem hiding this comment.
Seems, I was too tired at JabCon to see the obvious.
| @Test | ||
| public void containsReturnsTrueForEntryInAux() throws Exception { | ||
| Path auxFile = Paths.get(AuxParserTest.class.getResource("paper.aux").toURI()); | ||
| Path auxFile = Paths.get(TexGroupTest.class.getResource("paper.aux").toURI()); |
There was a problem hiding this comment.
Whats the reason for this change? The only "advantage" is that we now have a copy of the paper.aux file...
There was a problem hiding this comment.
I had the fear that maintainers of the AuxParserTest do not know that the TexGroupTest also relies on the aux file. What if another test is created? I would separate tests of different classes as much as possible even if files (.bib, .aux, ...) are duplicated.
…e-build # Conflicts: # src/main/java/org/jabref/cli/ArgumentProcessor.java # src/main/java/org/jabref/logic/exporter/ExporterFactory.java
|
OO fixed in 5c8e3e9. Tested in the UI. So, ready for review 😇 |
|
Since @Siedlerchr gave his "OK" and @tobiasdiez reviewed the intermediate steps, I'll fix the tests and merge to keep things moving. |

This is a follow-up to #3704. This PR separates logic and UI at more places. It cannot easily be based on
maintable-beta(#3621). I propose following procedure:maintable-beta([WIP] Main table JavaFX migration #3621)For the first step, just the following is open: