Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,21 @@ The `generateWindowsStarterExe` task uses a JDK 21 install and `launch4j` as def
`gradle.properties`.

Note this gradle task runs `jlink` directly and uses `launch4j` rather than using
`jpackage` directly since our app needs loose files and `jpackage` seems to require
all files being wrapped into the generated .exe. This is different than our OS X
app task (discussed below) which uses `jpackage`.
`jpackage` since our app needs loose files and `jpackage` seems to require all files
being wrapped into the generated .exe. This is different than our macOS app task
(discussed below) which uses `jpackage`.

After building the installable image, you can create the win32 installer by
running the `MakeRTextInstaller.nsi` [NSIS](https://nsis.sourceforge.io/Main_Page)
script at the root of the project.

### Building the OS X application
### Building the macOS application

Building the OS X package has just been revamped. To build the .app bundle into
`build/install/RText-<version>.dmg`:
To build the .app bundle into`build/install/RText-<version>.dmg`:

./gradlew clean build generateMacApp

The generated `RText-<version>.dmg` can be used to install `RText.app` to the Applications
folder. Note that this app currently isn't signed, so Gatekeeper will likely prevent
you from installing. In order to get around this you'll need to tweak your security
policy to allow installing of apps from outside the App Store.
you from installing. To get around this you'll need to tweak your security policy to
allow installing of apps from outside the App Store.
32 changes: 16 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jar {
// RText is odd in that we generate multiple jars from a single source tree.
//task mainJar(type: Jar) {
//}
task consoleJar(type: Jar) {
tasks.register('consoleJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/console/**'
archiveFileName = provider { 'plugin-console.jar' }
Expand All @@ -128,7 +128,7 @@ task consoleJar(type: Jar) {
)
}
}
task fileSystemTreeJar(type: Jar) {
tasks.register('fileSystemTreeJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/filesystemtree/**'
archiveFileName = provider { 'plugin-fileSystemTree.jar' }
Expand All @@ -140,7 +140,7 @@ task fileSystemTreeJar(type: Jar) {
)
}
}
task heapIndicatorJar(type: Jar) {
tasks.register('heapIndicatorJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/heapindicator/**'
archiveFileName = provider { 'plugin-heapIndicator.jar' }
Expand All @@ -152,7 +152,7 @@ task heapIndicatorJar(type: Jar) {
)
}
}
task macroSupportJar(type: Jar) {
tasks.register('macroSupportJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/macros/**'
archiveFileName = provider { 'plugin-macros.jar' }
Expand All @@ -164,7 +164,7 @@ task macroSupportJar(type: Jar) {
)
}
}
task projectSupportJar(type: Jar) {
tasks.register('projectSupportJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/project/**'
archiveFileName = provider { 'plugin-projects.jar' }
Expand All @@ -176,7 +176,7 @@ task projectSupportJar(type: Jar) {
)
}
}
task languageSupportJar(type: Jar) {
tasks.register('languageSupportJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/langsupport/**'
archiveFileName = provider { 'plugin-languageSupport.jar' }
Expand All @@ -188,7 +188,7 @@ task languageSupportJar(type: Jar) {
)
}
}
task sourceBrowserJar(type: Jar) {
tasks.register('sourceBrowserJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/sourcebrowser/**'
archiveFileName = provider { 'plugin-sourceBrowser.jar' }
Expand All @@ -200,7 +200,7 @@ task sourceBrowserJar(type: Jar) {
)
}
}
task taskListJar(type: Jar) {
tasks.register('taskListJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/tasks/**'
archiveFileName = provider { 'plugin-tasks.jar' }
Expand All @@ -212,7 +212,7 @@ task taskListJar(type: Jar) {
)
}
}
task tidyJar(type: Jar) {
tasks.register('tidyJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/tidy/**'
archiveFileName = provider { 'plugin-tidy.jar' }
Expand All @@ -224,7 +224,7 @@ task tidyJar(type: Jar) {
)
}
}
task toolsJar(type: Jar) {
tasks.register('toolsJar', Jar) {
from (sourceSets.main.output) {
include 'org/fife/rtext/plugins/tools/**'
archiveFileName = provider { 'plugin-tools.jar' }
Expand Down Expand Up @@ -394,7 +394,8 @@ def getWindowsJreDependencyList = { installDistDir ->
return retVal
}

task generateWindowsJre {
tasks.register('generateWindowsJre') {
dependsOn('build', 'installDist')
doLast {

def installDistDir = 'build/install/rtext'
Expand All @@ -410,26 +411,25 @@ task generateWindowsJre {
}
}
}
generateWindowsJre.dependsOn('build', 'installDist')

task generateWindowsStarterExe {
tasks.register('generateWindowsStarterExe') {
dependsOn('generateWindowsJre')
doLast {
exec {
commandLine launch4jExe, 'launch4j.xml'
}
}
}
generateWindowsStarterExe.dependsOn('generateWindowsJre')

task generateMacApp {
tasks.register('generateMacApp') {
dependsOn('build', 'installDist')
doLast {
def execOps = services.get(org.gradle.process.ExecOperations)
execOps.exec {
commandLine '/bin/bash', '-c', './mac/build-mac-app.sh'
}
}
}
generateMacApp.dependsOn('build', 'installDist')

nexusPublishing {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion mac/build-mac-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Builds RText.app for OS X. This assumes you've already run
# ./gradlew clean build installDist. In fact, you usually don't
# run this directly but rather just run
# ./gradlew clean build installDist generateJre generateMacApp
# ./gradlew clean build generateMacApp
#

# The version of RText you're building. This appears in the generated
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/fife/rtext/AbstractMainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.beans.PropertyChangeListener;
import java.io.*;
import java.net.URL;
import java.nio.file.FileSystems;
import java.util.*;
import java.util.Timer;
import javax.imageio.ImageIO;
Expand Down Expand Up @@ -1103,7 +1104,7 @@ public String getDefaultEncoding() {
*/
private String getDefaultFileName() {
return owner.getWorkingDirectory() +
System.getProperty("file.separator") + owner.getNewFileName();
FileSystems.getDefault().getSeparator() + owner.getNewFileName();
}


Expand Down Expand Up @@ -3551,7 +3552,7 @@ public void setLineNumbersEnabled(boolean enabled) {
*/
public void setLineTerminator(String terminator) {
if (terminator!=null &&
terminator.equals(System.getProperty("line.separator"))) {
terminator.equals(System.lineSeparator())) {
terminator = null;
}
defaultLineTerminator = terminator;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/fife/rtext/RTextMDIView.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ protected synchronized boolean closeCurrentDocumentImpl() {
// correctly. If there are no open documents, add a new empty one.
if (getNumDocuments()>0) {
renumberDisplayNames();
JInternalFrame frame = frames.get(0);
JInternalFrame frame = frames.getFirst();
desktopPane.setSelectedFrame(frame);
try {
frame.setSelected(true); // Updates currentTextArea.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/fife/rtext/RecentFileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private void addFile(String file) {
int index = indexOf(file);
if (index > -1) {
FileLocation loc = files.remove(index);
files.add(0, loc);
files.addFirst(loc);
return;
}

Expand All @@ -123,11 +123,11 @@ private void addFile(String file) {
// exist
return;
}
files.add(0, loc);
files.addFirst(loc);

// Too many files? Oust the file in history added least recently.
if (files.size() > MAX_FILE_COUNT) {
files.remove(files.size() - 1);
files.removeLast();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class GeneralOptionPanel extends OptionsDialogPanel
private static final String TERM_CR = "\r";
private static final String TERM_LF = "\n";
private static final String TERM_CRLF = "\r\n";
private static final String TERM_SYSTEM = System.getProperty("line.separator");
private static final String TERM_SYSTEM = System.lineSeparator();


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static File getClassFileLocation(LibraryInfo li) {
return ((JarLibraryInfo)li).getJarFile();
}
else if (li instanceof DirLibraryInfo) {
return new File(((DirLibraryInfo)li).getLocationAsString());
return new File(li.getLocationAsString());
}
else if (li instanceof Jdk9LibraryInfo) {
return ((Jdk9LibraryInfo)li).getJreHome();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public List<PopupContent> getPopupActions() {
Messages.getString("Action.New"));
newMenu.add(new NewFileOrFolderAction(this, true));
newMenu.add(new NewFileOrFolderAction(this, false));
actions.add(0, newMenu);
actions.addFirst(newMenu);

actions.add(actions.size()-1, new ConfigureFiltersAction());

Expand Down