Skip to content

Commit

Permalink
update gradle to new version 8.5
Browse files Browse the repository at this point in the history
- new factory method for create the application configuration file name and the application configuration file
- update of gradle-plugin dependency 'com.diffplug.spotless:spotless-plugin-gradle' to new version 6.23.3
- update of test dependency miglayout-swing version to 11.3
  • Loading branch information
astrapi69 committed Dec 19, 2023
1 parent 265b003 commit fde835a
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
Version 4.3-SNAPSHOT
-------------

ADDED:

- new factory method for create the application configuration file name and the application configuration file

CHANGED:

- update gradle to new version 8.5
- update of gradle-plugin dependency 'com.diffplug.spotless:spotless-plugin-gradle' to new version 6.23.3
- update of test dependency miglayout-swing version to 11.3

Version 4.2
-------------
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ gradlePluginLombokVersion=8.4
gradlePluginVersionsVersion=0.50.0
licenseGradlePluginVersion=0.16.1
grgitGradlePluginVersion=5.2.1
spotlessGradlePluginVersion=6.22.0
spotlessGradlePluginVersion=6.23.3
#########################
# dependencies versions #
#########################
Expand All @@ -53,7 +53,7 @@ iconImgExtensionsVersion=3.2
testObjectVersion=8.2
fileWorkerVersion=17.1
sillyIoVersion=3
miglayoutSwingVersion=11.2
miglayoutSwingVersion=11.3
meanbeanVersion=3.0.0-M9
junitJupiterExtensionsVersion=1.1
junitJupiterVersion=5.10.1
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Wed Feb 19 18:39:09 CET 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-rc-3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,20 @@ public abstract class AbstractApplicationFrame<T, C extends JComponent> extends
* value:".config"
*/
public static final String DEFAULT_APPLICATION_CONFIGURATION_DIRECTORY_NAME = ".config";

/**
* Constant for the default configuration file name from the current application. current
* value:"application-configuration.properties"
*/
public static final String DEFAULT_APPLICATION_CONFIGURATION_FILE_NAME = "application-configuration.properties";
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The configuration directory for configuration files. */
@Getter
File configurationDirectory;
/** The application configuration file */
@Getter
File configurationFile;
/** The current look and feels. */
@Getter
@Setter
Expand Down Expand Up @@ -121,6 +130,8 @@ protected void onBeforeInitialize()
applicationName = newApplicationName();
configurationDirectory = newConfigurationDirectory(System.getProperty("user.home"),
newApplicationConfigurationDirectoryName());
configurationFile = newConfigurationFile(configurationDirectory,
newApplicationConfigurationFileName());
}

/**
Expand Down Expand Up @@ -231,10 +242,45 @@ protected File newConfigurationDirectory(final @NonNull String parent,
return configurationDir;
}


/**
* Factory method for create a new configuration directory {@link File} object if it is not
* exists. This method is invoked in the constructor and can be overridden from the derived
* classes so users can provide their own version of a new configuration {@link File} object
*
* @param configurationDir
* the configuration directory
* @param configurationFileName
* the configuration file name
* @return the new configuration file {@link File} object or the existing one
*/
protected File newConfigurationFile(final @NonNull File configurationDir,
final @NonNull String configurationFileName)
{
if (!configurationDir.isDirectory())
{
throw new RuntimeException(
"Given configuration directory file object is not a directory");
}
File configurationFile = new File(configurationDir, configurationFileName);
if (!configurationFile.exists())
{
try
{
configurationFile.createNewFile();
}
catch (IOException ioException)
{
throw new RuntimeException("Given configuration file object could not created");
}
}
return configurationFile;
}

/**
* Factory method for create the new application configuration directory name. This method is
* invoked in the constructor and should be overridden from the derived classes for set the
* actual application name
* actual application directory name
*
* @return the new application configuration directory name
*/
Expand All @@ -243,6 +289,18 @@ protected String newApplicationConfigurationDirectoryName()
return DEFAULT_APPLICATION_CONFIGURATION_DIRECTORY_NAME;
}

/**
* Factory method for create the new application configuration file name. This method is invoked
* in the constructor and should be overridden from the derived classes for set the actual
* application configuration file name
*
* @return the new application configuration file name
*/
protected String newApplicationConfigurationFileName()
{
return DEFAULT_APPLICATION_CONFIGURATION_FILE_NAME;
}

/**
* Factory method for create a new {@link BaseDesktopMenu} object.
*
Expand Down

0 comments on commit fde835a

Please sign in to comment.