Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fixFileUpdateMoni…
Browse files Browse the repository at this point in the history
…torShutdown

* upstream/master:
  Add connection check to NetworkTab in preferences (#6838)
  Refine IntelliJ howto to enable built-in compiler again (#6794)
  GitBook: [master] one page modified
  GitBook: [master] 3 pages and 3 assets modified
  Add missing }
  Refactor of remaining preference tabs to PreferencesService (#6836)
  ChipView for crossref and groups (#6228)
  Ignore codecov.io at external link check
  Fix linting issues
  Add "m-mauersberger"
  Update journalList.mv
  • Loading branch information
Siedlerchr committed Sep 2, 2020
2 parents 31330d1 + 1b3c270 commit e5d46cb
Show file tree
Hide file tree
Showing 70 changed files with 569 additions and 376 deletions.
4 changes: 2 additions & 2 deletions .idea/runConfigurations/JabRef_Main.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Lucas Beretti
Luciana de Melo e Abud
Lugduni Desrosiers
Luis Romero
m-mauersberger
Mairieli Wessel
Malik Atalla
Malte Deiseroth
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

- We added a query parser and mapping layer to enable conversion of queries formulated in simplified lucene syntax by the user into api queries. [#6799](https://github.com/JabRef/jabref/pull/6799)
- We added some basic functionality to customise the look of JabRef by importing a css theme file. [#5790](https://github.com/JabRef/jabref/issues/5790)
- We added connection check function in network preference setting [#6560](https://github.com/JabRef/jabref/issues/6560)

### Changed

- We restructured the 'File' tab and extracted some parts into the 'Linked files' tab [#6779](https://github.com/JabRef/jabref/pull/6779)
- JabRef now offers journal lists from <https://abbrv.jabref.org>. JabRef the lists which use a dot inside the abbreviations. [#5749](https://github.com/JabRef/jabref/pull/5749)
- We removed two useless preferences in the groups preferences dialog. [#6836](https://github.com/JabRef/jabref/pull/6836)

### Fixed

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
6 changes: 3 additions & 3 deletions docs/adr/0016-mutable-preferences-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Context and Problem Statement

To create an immutable preferences object every time seems to be a waste of time and computer memory.
To create an immutable preferences object every time seems to be a waste of time and computer memory.

## Considered Options

* Create a new object every time a preferences object should be altered by a with*-method, similar to a Builder.
* Create a new object every time a preferences object should be altered by a with*-method, similar to a builder.
* Alter the existing object and return it.

## Decision Outcome

Chosen option: 1, because the preferences objects are just wrappers around the basic preferences framework of JDK. They
Chosen option: "Alter the exiting object", because the preferences objects are just wrappers around the basic preferences framework of JDK. They
should be mutable on-the-fly similar to objects with a Builder inside and to be stored immediatly again in the
preferences.
5 changes: 2 additions & 3 deletions docs/getting-into-the-code/code-howtos.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ Principles:
* Catch and wrap all API exceptions \(such as `IOExceptions`\) and rethrow them
* Example:

```java
```java
try {
// ...
} catch (IOException ioe) {
throw new JabRefException("Something went wrong...",
Localization.lang("Something went wrong...", ioe);
}
```

```
* Never, ever throw and catch `Exception` or `Throwable`
* Errors should only be logged when they are finally caught \(i.e., logged only once\). See **Logging** for details.
* If the Exception message is intended to be shown to the User in the UI \(see below\) provide also a localizedMessage \(see `JabRefException`\).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ It is strongly recommend that you have git installed.

We suggest [IntelliJ IDEA](https://www.jetbrains.com/idea/) or [Eclipse \(for advanced users\)](https://eclipse.org/) \(`2020-03` or newer\).

Under Ubuntu Linux, you can follow the [documentation from the Ubuntu Community](https://help.ubuntu.com/community/EclipseIDE#Download_Eclipse) or the [step-by-step guideline from Krizna](https://www.krizna.com/ubuntu/install-eclipse-in-ubuntu-12-04/) to install Eclipse. Under Windows, download it from [www.eclipse.org](http://www.eclipse.org/downloads/) and run the installer.
On Ubuntu Linux, you can follow the [documentation from the Ubuntu Community](https://help.ubuntu.com/community/EclipseIDE#Download_Eclipse) or the [step-by-step guideline from Krizna](https://www.krizna.com/ubuntu/install-eclipse-in-ubuntu-12-04/) to install Eclipse. Under Windows, download it from [www.eclipse.org](http://www.eclipse.org/downloads/) and run the installer.

### Other Tooling

Expand Down Expand Up @@ -88,26 +88,22 @@ These steps are very important. They allow you to focus on the content and ensur

### Setup for IntelliJ IDEA

IntelliJ IDEA fully supports Gradle as a build tool, but also has an internal build system which is usually faster. For JabRef, Gradle is required to make a full build but once set up, IntelliJ IDEA's internal system can be used for sub-sequent builds.
We recommend to install IntelliJ IDEA using [JetBrains Toolbox App](https://www.jetbrains.com/toolbox-app/), because IDE updates are automatically installed.

To configure IntelliJ IDEA for developing JabRef, you should first ensure that you have enabled both bundled plugins _Gradle_ and _Gradle Extension_
IntelliJ IDEA fully supports Gradle as a build tool, but also has an internal build system which is usually faster. For JabRef, Gradle is required to make a full build but once set up, IntelliJ IDEA's internal system can be used for sub-sequent builds.

* Navigate to **File \| Settings \| Plugins \| Installed** and check that you have
To configure IntelliJ IDEA for developing JabRef, you should first ensure that you have enabled both bundled plugins _Gradle_ and _Gradle Extension_:

the _Gradle_ and _Gradle Extension_ enabled.
* Navigate to **File \| Settings \| Plugins \| Installed** and check that you have the _Gradle_ and _Gradle Extension_ enabled.

After that, you can open `jabref/build.gradle` as a project. It is crucial that Java 14 is used consistently for the JabRef project which includes ensuring the right settings for your project structure, Gradle build, and run configurations.

* Ensure you have a Java 14 SDK configured by navigating to

**File \| Project Structure \| Platform Settings \| SDKs**. If you don't have one, add a new Java JDK and point it to the

location of a JDK 14.
Ensure you have a Java 14 SDK configured by navigating to **File \| Project Structure \| Platform Settings \| SDKs**. If you don't have one, add a new Java JDK and point it to the location of a JDK 14:

* Navigate to **File \| Project Structure \| Project** and ensure that the projects' SDK is Java 14
* Navigate to **File \| Settings \| Build, Execution, Deployment \| Build Tools \| Gradle** and select the Java 14 SDK as the Gradle JVM at the bottom.

To prepare IntelliJ's build system two additional steps are required
To prepare IntelliJ's build system two additional steps are required:

* Navigate to **File \| Settings \| Build, Execution, Deployment \| Compiler \| Java Compiler**, and under "Override compiler parameters per-module" add \(\[+\]\) the following compiler arguments for the `JabRef.main` module:

Expand All @@ -118,16 +114,19 @@ To prepare IntelliJ's build system two additional steps are required

* Enable annotation processors by navigating to **File \| Settings \| Build, Execution, Deployment \| Compiler \| Annotation processors** and check "Enable annotation processing"

![Enable annotation processing](../.gitbook/assets/intellij-enable-annotation-processing.png)

To have autoformat working properly in the context of line wrapping, "Wrap at right margin" has to be disabled as shown below. Details are found in [IntelliJ issue 240517](https://youtrack.jetbrains.com/issue/IDEA-240517).

![Disable wrapping at right margin to prevent JavaDoc to be wrapped](../.gitbook/assets/grafik%20%281%29.png)
![Disable wrapping at right margin to prevent JavaDoc to be wrapped](../.gitbook/assets/intellij-wrap-at-right-margin.png)

#### Using Gradle from within IntelliJ IDEA

Ensuring JabRef builds with Gradle should always the first step because, e.g. it generates additional sources that are required for compiling the code. After adjusting all settings mentioned earlier, your first step should be to

* Open the Gradle Tool Window with the small button that can usually be found on the right side of IDEA or navigate to **View \| Tool Windows \| Gradle**.
* In the Gradle Tool Window, press the "Reimport All Gradle Projects" button to ensure that all settings are up-to-date with the setting changes.
* In the Gradle Tool Window, press the "Reimport All Gradle Projects" button to ensure that all settings are up-to-date
with the setting changes.

After that, you can use the Gradle Tool Window to build all parts JabRef and run it. To do so, expand the JabRef project in the Gradle Tool Window and navigate to Tasks. From there, you can

Expand All @@ -137,44 +136,54 @@ After that a new entry called "jabref \[run\]" will appear in the run configurat

#### Using IntelliJ's internal build system

**Note that these steps do not work on IntelliJ 2020.x.**. You have to keep using gradle for executing tasks.
See [IDEA-249391](https://youtrack.jetbrains.com/issue/IDEA-249391) for details.

You should use IntelliJ IDEA's internal build system for compiling and running JabRef during development, because it is usually more responsive. Thereby, **it's important** that you understand that JabRef relies on generated sources which are only build through Gradle. Therefore, to build or update these dependencies you need to run the `assemble` Gradle task at least once.

To use IntelliJ IDEA's internal build system when you build JabRef through **Build \| Build Project** or use the provided "JabRef Main" run configuration, ensure that

* In **File \| Settings \| Build, Execution, Deployment \| Build Tools \| Gradle** the setting "Build and run using" and "Test using" is set to "IntelliJ IDEA".
* Ignore the Gradle project "buildSrc" by clicking the button **Select Project Data To Import** in the Gradle Tool Window and unchecking the folder "buildSrc".
![Ignore the Gradle project &quot;buildSrc&quot;](../.gitbook/assets/intellij-gradle-config-ignore-buildSrc.png)
* Delete `org.jabref.gui.logging.plugins.Log4jPlugins` (location: `generated\org\jabref\gui\logging\plugins\Log4jPlugins.java`). Otherwise, you will see folowing error:

```text
Error:java: Unable to create Plugin Service Class org.jabref.gui.logging.plugins.Log4jPlugins
```

![Ignore the Gradle project &quot;buildSrc&quot;](../.gitbook/assets/intellij-gradle-config-ignore-buildSrc%20%281%29.png)
or following error:

```text
Error:(16, 25) java: package org.jabref.search does not exist
```

Essentially, you now have the best of both worlds: You can run Gradle tasks using the Gradle Tool Window and unless you haven't made changes to input files that generate sources, you can compile and run with IntelliJ's faster internal build system.

In case all steps are followed, and there are still issues with `SearchBaseVisitor` (e.g., `Error:(16, 25) java: package org.jabref.search does not exist`), you have to delete `generated\org\jabref\gui\logging\plugins\Log4jPlugins.java`. This is independet of having enabled or disabled Annotation Processing (see above at "Enable Annotation Processing").

#### Using JabRef's code style

Contributions to JabRef's source code need to have a code formatting that is consistent with existing source code. For that purpose, JabRef provides code-style and check-style definitions.

* Install the [CheckStyle-IDEA plugin](http://plugins.jetbrains.com/plugin/1065?pr=idea), it can be found via the plug-in repository:

1. Navigate to **File \| Settings \| Plugins \| Marketplace** and search for "Checkstyle" and choose "CheckStyle-IDEA"
2. Close the settings afterwards and restart IntelliJ

1. Navigate to **File \| Settings \| Plugins \| Marketplace** and search for "Checkstyle" and choose "CheckStyle-IDEA"
2. Close the settings afterwards and restart IntelliJ
* Go to **File \| Settings \| Editor \| Code Style**
* Click on the settings wheel \(next to the scheme chooser\), then click "Import Scheme"
* Select the IntelliJ configuration file `config/IntelliJ Code Style.xml`
* Go to **File \| Settings \| Tools \| Checkstyle \| Configuration File**

1. Import the CheckStyle configuration file by clicking the \[+\] button
2. For the description provide "JabRef"
3. Click "Browse" and choose `config/checkstyle/checkstyle.xml`
4. Click "Next" and "Finish"
5. Activate the CheckStyle configuration file by ticking it in the list
6. Ensure that the [latest CheckStyle version](https://checkstyle.org/releasenotes.html) is selected \(8.36 or higher\). 8.36 is required for Java 14.
7. Set the "Scan Scope" to "Only Java sources \(including tests\)
8. Save settings by clicking "OK"
9. Your configuration should now look like this:

```text
1. Import the CheckStyle configuration file by clicking the \[+\] button
2. For the description provide "JabRef"
3. Click "Browse" and choose `config/checkstyle/checkstyle.xml`
4. Click "Next" and "Finish"
5. Activate the CheckStyle configuration file by ticking it in the list
6. Ensure that the [latest CheckStyle version](https://checkstyle.org/releasenotes.html) is selected \(8.36 or higher\). 8.36 is required for Java 14.
7. Set the "Scan Scope" to "Only Java sources \(including tests\)
8. Save settings by clicking "OK"
9. Your configuration should now look like this:

![checkstyle settings](../.gitbook/assets/intellij-checkstyle-settings.png)
```

### Setup for Eclipse

Expand All @@ -191,7 +200,7 @@ Make sure your Eclipse installation us up to date, Eclipse JEE 2020-03 or newer
4. Create a run/debug configuration for the main class `org.jabref.JabRefLauncher` and/or for `org.jabref.JabRefMain` \(both can be used equivalently\)
* Remark: The run/debug configuration needs to be added by right clicking the class \(e.g. JabRefLauncher or JabRefMain\) otherwise it will not work.

![Creating the run/debug configuration by right clicking on the class](../.gitbook/assets/eclipse-create-run-config.png)
![Creating the run/debug configuration by right clicking on the class](../.gitbook/assets/eclipse-create-run-config%20%281%29.png)

* In the tab "Arguments" of the run/debug configuration, enter the following runtime VM arguments:

Expand Down Expand Up @@ -250,4 +259,3 @@ java.lang.UnsupportedClassVersionError: org/javamodularity/moduleplugin/ModuleSy
### Problems with generated source files

In rare cases you might encounter problems due to out-dated automatically generated source files. Running `./gradlew clean` deletes these old copies. Do not forget to run at least `./gradlew eclipse` or `./gradlew build` afterwards to regenerate the source files.

5 changes: 5 additions & 0 deletions docs/teaching.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ We recommend to start early and constantly, since students working earlier and m
2. Be aware that from the first pull request to the final acceptance the typical time needed is two weeks.
3. Be aware that JabRef tries to achieve high code quality. This leads to code reviews requiring actions from the contributors. This also applies for code of students. Read on at our [Development Strategy](getting-into-the-code/development-strategy.md) for more details.
4. Choose tasks from one of the following boards. Write a comment on each issue so that it can be reserved for your course.
* Candidates for university projects: [https://github.com/JabRef/jabref/projects/9](https://github.com/JabRef/jabref/projects/9)
* This board categorizes in small, medium, and large features
* Feature Board: [https://github.com/JabRef/jabref/projects/7](https://github.com/JabRef/jabref/projects/7)
* This is a general feature board. Recommended, if the board above is empty or you did not find something suitable
* Bug Board: [https://github.com/JabRef/jabref/projects/5](https://github.com/JabRef/jabref/projects/5)
* This is an excellent board to find issues training the maintainance knowledge which is essential for industry work
* General "good first issues". The JabRef team tags issues as [good first issues](https://github.com/jabref/jabref/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) to indicate open tasks offering a good start into the JabRef code. These issues are more a list of random bugs and features. For a more structured comparison of the opened tasks, we recommend the projectd boards listed above.
5. Be aware that the difficulty of bugs and feature vary. A task should be chosen with care. The JabRef team can help here: The majority of the team has experiences in teaching
6. Get in touch with the JabRef team to discuss details. We offer email, skype, [gitter.im](https://gitter.im/JabRef/jabref), discord. Get in touch with [@koppor](https://github.com/koppor/) to find the right channel and to start forming the success of your course.

Expand Down
Loading

0 comments on commit e5d46cb

Please sign in to comment.