Skip to content

Commit

Permalink
update of all dependencies with gradle-plugin catalog-update
Browse files Browse the repository at this point in the history
- adapted classes for appropriate work with new update of dependencies
  • Loading branch information
astrapisixtynine committed Aug 3, 2024
1 parent dc70117 commit ac1942d
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 87 deletions.
23 changes: 7 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ buildscript {
}

plugins {
id 'java'
id 'idea'
id 'jacoco'
id 'java'
id 'java-library'
id 'maven-publish'
id 'signing'
id 'jacoco'
alias(libs.plugins.lombok.plugin)
alias(libs.plugins.gradle.versions.plugin)
alias(libs.plugins.license.gradle.plugin)
alias(libs.plugins.gradle.izpack.plugin)
alias(libs.plugins.gradle.versions.plugin)
alias(libs.plugins.grgit.gradle)
alias(libs.plugins.license.gradle.plugin)
alias(libs.plugins.lombok.plugin)
alias(libs.plugins.spotless.plugin.gradle)
alias(libs.plugins.version.catalog.update)
}
Expand All @@ -27,16 +27,7 @@ version = "$projectVersion" as Object
description = "$rootProject.name"

// import gradle files
apply from: "gradle/dependencies.gradle"
apply from: "gradle/formatting.gradle"
apply from: "gradle/grgit.gradle"
apply from: "gradle/izpack.gradle"
apply from: "gradle/licensing.gradle"
apply from: "gradle/packaging.gradle"
apply from: "gradle/publishing.gradle"
apply from: "gradle/repositories.gradle"
apply from: "gradle/testing.gradle"
apply from: "gradle/version-catalog-update.gradle"
apply from: "gradle/apply-gradle-files.gradle"

java {
sourceCompatibility = "$projectSourceCompatibility" as Object
Expand All @@ -48,7 +39,7 @@ java {
tasks.withType(JavaCompile).configureEach { javaCompiler ->
options.encoding = "UTF-8"
// uncomment the next line for build with compiler argument -Xlint:deprecation
// options.compilerArgs << "-Xlint:deprecation"
options.compilerArgs << "-Xlint:deprecation"
// uncomment the next line for build with compiler argument -Xlint:unchecked
// options.compilerArgs << "-Xlint:unchecked"
}
Expand Down
8 changes: 8 additions & 0 deletions gradle/apply-gradle-files.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// import gradle files
// Read the list of Gradle files from a file
def gradleFiles = file('gradle/gradle-files.list').readLines()

// Apply the Gradle files
gradleFiles.each { file ->
apply from: file
}
9 changes: 6 additions & 3 deletions gradle/formatting.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

spotless {

format "misc", {
Expand All @@ -11,8 +10,12 @@ spotless {
endWithNewline()
}
java {
// export config file: https://github.com/diffplug/spotless/blob/main/ECLIPSE_SCREENSHOTS.md#creating-spotlessimportorder
importOrderFile('src/test/resources/spotless/importorder.properties') // import order file as exported from eclipse
// export config file:
// https://github.com/diffplug/spotless/blob/main/ECLIPSE_SCREENSHOTS.md#creating-spotlessimportorder
importOrderFile('src/test/resources/spotless/importorder.properties')
// removes any unused imports
removeUnusedImports()
// import order file as exported from eclipse
eclipse("4.21").configFile("src/test/resources/spotless/alpharo-formatter.xml")
}
}
10 changes: 10 additions & 0 deletions gradle/gradle-files.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gradle/dependencies.gradle
gradle/formatting.gradle
gradle/grgit.gradle
gradle/izpack.gradle
gradle/licensing.gradle
gradle/packaging.gradle
gradle/publishing.gradle
gradle/repositories.gradle
gradle/testing.gradle
gradle/version-catalog-update.gradle
30 changes: 15 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ bcpkix-jdk15on-version = "1.70"
bcprov-ext-jdk15on-version = "1.70"
bcprov-jdk15on-version = "1.70"
checksum-up-version = "3"
commons-codec-version = "1.17.0"
commons-lang3-version = "3.14.0"
commons-codec-version = "1.17.1"
commons-lang3-version = "3.15.0"
component-model-version = "2"
crypt-api-version = "9"
crypt-data-version = "9"
crypt-api-version = "9.3"
crypt-data-version = "9.4"
data-api-version = "4.1"
eventbus-version = "6"
file-worker-version = "17.2"
file-worker-version = "17.3"
gen-tree-version = "9"
gradle-izpack-plugin-version = "3.2"
gradle-plugin-grgit-version = "5.2.2"
Expand All @@ -24,14 +24,14 @@ gradle-plugin-lombok-version = "8.6"
gradle-plugin-spotless-version = "7.0.0.BETA1"
gradle-plugin-version-catalog-update-version = "0.8.4"
gradle-plugin-versions-version = "0.51.0"
gson-extensions-version = "2.1"
gson-extensions-version = "3.1"
gson-version = "2.11.0"
guava-version = "33.2.1-jre"
icon-img-extensions-version = "3.3"
icon-img-extensions-version = "4"
id-generate-version = "1.1"
imgscalr-lib-version = "4.2"
izpack-ant-version = "5.2.1"
jackson-databind-version = "2.17.1"
izpack-ant-version = "5.2.2"
jackson-databind-version = "2.17.2"
javahelp-version = "2.0.05"
jobj-cloner-version = "2.1"
jobj-copy-version = "4.2"
Expand All @@ -43,23 +43,23 @@ junit-platform-launcher-version = "1.11.0-M2"
jxlayer-version = "3.0.4"
kee-pass-java2-version = "2.2.1"
lgood-date-picker-version = "11.2.1"
lombok-version = "1.18.32"
lombok-version = "1.18.34"
meanbean-version = "3.0.0-M9"
menu-action-version = "3.4"
miglayout-swing-version = "11.3"
miglayout-swing-version = "11.4"
mockito-core-version = "5.12.0"
model-data-version = "3.1"
mystic-crypt-version = "9"
mystic-crypt-version = "9.1"
net-extensions-version = "5.2"
observer-version = "6"
pf4j-version = "3.11.1"
pf4j-version = "3.12.0"
randomizer-version = "10.2"
resource-viewmodels-version = "6"
resourcebundle-core-version = "5"
silk-icon-theme-version = "1"
silly-bean-version = "2"
silly-collection-version = "27.1"
silly-io-version = "3"
silly-io-version = "3.1"
sqlite-jdbc-version = "3.46.0.0"
state-version = "6"
swing-base-components-version = "4.2"
Expand All @@ -74,7 +74,7 @@ swing-worker-version = "1.1"
swingx-all-version = "1.6.5-1"
tango-icon-theme-version = "0.8.90"
test-object-version = "8.2"
throwable-version = "2.3"
throwable-version = "3"
tree-api-version = "1.5"
visitor-version = "6"
xml-extensions-version = "8.2"
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 @@
#Mon May 11 15:57:08 CEST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
3 changes: 0 additions & 3 deletions lombok.config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import javax.swing.*;

import io.github.astrapi69.crypt.data.certificate.CertificateInfo;
import io.github.astrapi69.crypt.data.model.X509CertificateV3Info;
import io.github.astrapi69.model.BaseModel;
import io.github.astrapi69.model.api.IModel;
import io.github.astrapi69.swing.base.BasePanel;
Expand All @@ -37,7 +37,7 @@
* @author astrapi69
*/
@Getter
public class CertificatePanel extends BasePanel<CertificateInfo>
public class CertificatePanel extends BasePanel<X509CertificateV3Info>
{

/**
Expand Down Expand Up @@ -74,10 +74,10 @@ public class CertificatePanel extends BasePanel<CertificateInfo>

public CertificatePanel()
{
this(BaseModel.of(CertificateInfo.builder().build()));
this(BaseModel.of(X509CertificateV3Info.builder().build()));
}

public CertificatePanel(final IModel<CertificateInfo> model)
public CertificatePanel(final IModel<X509CertificateV3Info> model)
{
super(model);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import javax.swing.*;

import io.github.astrapi69.crypt.data.certificate.CertificateAttributes;
import io.github.astrapi69.crypt.data.model.DistinguishedNameInfo;
import io.github.astrapi69.model.BaseModel;
import io.github.astrapi69.model.api.IModel;
import io.github.astrapi69.swing.base.BasePanel;
Expand All @@ -41,7 +41,7 @@
* @author astrapi69
*/
@Getter
public class NewCertificateAttributesPanel extends BasePanel<CertificateAttributes>
public class NewCertificateAttributesPanel extends BasePanel<DistinguishedNameInfo>
{
private JLabel lblCommonName;
private JLabel lblCountryCode;
Expand All @@ -58,10 +58,10 @@ public class NewCertificateAttributesPanel extends BasePanel<CertificateAttribut

public NewCertificateAttributesPanel()
{
this(BaseModel.of(CertificateAttributes.builder().build()));
this(BaseModel.of(DistinguishedNameInfo.builder().build()));
}

public NewCertificateAttributesPanel(final IModel<CertificateAttributes> model)
public NewCertificateAttributesPanel(final IModel<DistinguishedNameInfo> model)
{
super(model);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
import javax.swing.*;
import javax.swing.table.DefaultTableModel;

import io.github.astrapi69.crypt.data.certificate.CertificateInfo;
import io.github.astrapi69.crypt.data.model.DistinguishedNameInfo;
import io.github.astrapi69.crypt.data.model.X509CertificateV1Info;
import io.github.astrapi69.crypt.data.model.X509CertificateV3Info;
import io.github.astrapi69.model.BaseModel;
import io.github.astrapi69.model.api.IModel;
import io.github.astrapi69.mystic.crypt.MysticCryptApplicationFrame;
Expand All @@ -40,7 +42,7 @@
import lombok.Getter;

@Getter
public class NewCertificateInfoPanel extends BasePanel<CertificateInfo>
public class NewCertificateInfoPanel extends BasePanel<X509CertificateV3Info>
{

private JButton btnAddExtension;
Expand Down Expand Up @@ -70,10 +72,10 @@ public class NewCertificateInfoPanel extends BasePanel<CertificateInfo>

public NewCertificateInfoPanel()
{
this(BaseModel.<CertificateInfo> of(CertificateInfo.builder().build()));
this(BaseModel.<X509CertificateV3Info> of(X509CertificateV3Info.builder().build()));
}

public NewCertificateInfoPanel(final IModel<CertificateInfo> model)
public NewCertificateInfoPanel(final IModel<X509CertificateV3Info> model)
{
super(model);
}
Expand Down Expand Up @@ -326,14 +328,15 @@ protected void onCreateIssuer(java.awt.event.ActionEvent evt)

if (optionPane.getValue().equals(JOptionPane.OK_OPTION))
{
panel.getModelObject().setCommonName(panel.getTxtCommonName().getText());
panel.getModelObject().setCountryCode(panel.getTxtCountryCode().getText());
panel.getModelObject().setLocation(panel.getTxtLocation().getText());
panel.getModelObject().setOrganisation(panel.getTxtOrganization().getText());
panel.getModelObject().setOrganisationUnit(panel.getTxtOrganizationUnit().getText());
panel.getModelObject().setState(panel.getTxtState().getText());
String issuer = panel.getModelObject().toRepresentableString();
getModelObject().setIssuer(issuer);
DistinguishedNameInfo newIssuerModelObject = getDistinguishedNameInfo(panel);

String issuer = newIssuerModelObject.toRepresentableString();
X509CertificateV3Info oldModelObject = getModelObject();
X509CertificateV1Info x509CertificateV1Info = oldModelObject.getCertificateV1Info()
.toBuilder().issuer(newIssuerModelObject).build();
X509CertificateV3Info x509CertificateV3Info = oldModelObject.toBuilder()
.certificateV1Info(x509CertificateV1Info).build();
setModelObject(x509CertificateV3Info);
getTxtIssuer().setText(issuer);
}

Expand All @@ -342,7 +345,12 @@ protected void onCreateIssuer(java.awt.event.ActionEvent evt)
protected void onGenerateSerialNumber(java.awt.event.ActionEvent evt)
{
BigInteger serialNumber = RandomBigIntegerFactory.randomSerialNumber();
getModelObject().setSerialNumber(serialNumber);
X509CertificateV3Info oldModelObject = getModelObject();
X509CertificateV1Info x509CertificateV1Info = oldModelObject.getCertificateV1Info()
.toBuilder().serial(serialNumber).build();
X509CertificateV3Info x509CertificateV3Info = oldModelObject.toBuilder()
.certificateV1Info(x509CertificateV1Info).build();
setModelObject(x509CertificateV3Info);
getTxtSerialNumber().setText(serialNumber.toString());
}

Expand All @@ -362,18 +370,33 @@ protected void onCreateSubject(java.awt.event.ActionEvent evt)

if (optionPane.getValue().equals(JOptionPane.OK_OPTION))
{
panel.getModelObject().setCommonName(panel.getTxtCommonName().getText());
panel.getModelObject().setCountryCode(panel.getTxtCountryCode().getText());
panel.getModelObject().setLocation(panel.getTxtLocation().getText());
panel.getModelObject().setOrganisation(panel.getTxtOrganization().getText());
panel.getModelObject().setOrganisationUnit(panel.getTxtOrganizationUnit().getText());
panel.getModelObject().setState(panel.getTxtState().getText());
String subject = panel.getModelObject().toRepresentableString();
getModelObject().setSubject(subject);
DistinguishedNameInfo newSubjectModelObject = getDistinguishedNameInfo(panel);

String subject = newSubjectModelObject.toRepresentableString();
X509CertificateV3Info oldModelObject = getModelObject();
X509CertificateV1Info x509CertificateV1Info = oldModelObject.getCertificateV1Info()
.toBuilder().subject(newSubjectModelObject).build();
X509CertificateV3Info x509CertificateV3Info = oldModelObject.toBuilder()
.certificateV1Info(x509CertificateV1Info).build();
setModelObject(x509CertificateV3Info);
getTxtSubject().setText(subject);
}
}

private static DistinguishedNameInfo getDistinguishedNameInfo(
NewCertificateAttributesPanel panel)
{
DistinguishedNameInfo newModelObject = DistinguishedNameInfo.builder()
.commonName(panel.getTxtCommonName().getText())
.countryCode(panel.getTxtCountryCode().getText())
.location(panel.getTxtLocation().getText())
.organisation(panel.getTxtOrganization().getText())
.organisationUnit(panel.getTxtOrganizationUnit().getText())
.state(panel.getTxtState().getText()).build();
panel.setModelObject(newModelObject);
return newModelObject;
}

protected void onAddExtension(java.awt.event.ActionEvent evt)
{

Expand Down
Loading

0 comments on commit ac1942d

Please sign in to comment.