2019-03-12 14:18:22 +00:00
|
|
|
evaluationDependsOn(":node:capsule")
|
2018-11-20 13:38:44 +00:00
|
|
|
|
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
import com.github.dockerjava.api.model.Identifier
|
|
|
|
import net.corda.build.docker.DockerImage
|
|
|
|
import net.corda.build.docker.DockerUtils
|
|
|
|
import net.corda.build.docker.ObjectInputStreamWithCustomClassLoader
|
|
|
|
|
|
|
|
import java.nio.file.Files
|
|
|
|
import java.nio.file.StandardCopyOption
|
2018-11-20 13:38:44 +00:00
|
|
|
import java.time.LocalDateTime
|
|
|
|
import java.time.format.DateTimeFormatter
|
2020-11-20 10:21:53 +00:00
|
|
|
import java.util.stream.Collectors
|
|
|
|
import java.util.stream.Stream
|
2018-11-20 13:38:44 +00:00
|
|
|
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
apply plugin: 'org.jetbrains.kotlin.jvm'
|
2018-11-20 13:38:44 +00:00
|
|
|
apply plugin: 'application'
|
2019-09-05 12:02:51 +00:00
|
|
|
|
2018-11-20 13:38:44 +00:00
|
|
|
// We need to set mainClassName before applying the shadow plugin.
|
|
|
|
mainClassName = 'net.corda.core.ConfigExporterMain'
|
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
|
|
|
|
|
|
dependencies{
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
implementation project(':node')
|
|
|
|
implementation project(':node-api')
|
|
|
|
implementation project(':common-configuration-parsing')
|
|
|
|
implementation project(':common-validation')
|
|
|
|
|
|
|
|
implementation "com.typesafe:config:$typesafe_config_version"
|
2018-11-20 13:38:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
shadowJar {
|
|
|
|
baseName = 'config-exporter'
|
|
|
|
classifier = null
|
|
|
|
version = null
|
|
|
|
zip64 true
|
2019-10-21 12:31:09 +00:00
|
|
|
exclude '**/Log4j2Plugins.dat'
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes('Add-Opens': 'java.management/com.sun.jmx.mbeanserver ' +
|
|
|
|
'java.base/java.time java.base/java.io ' +
|
|
|
|
'java.base/java.util java.base/java.net ' +
|
|
|
|
'java.base/java.nio java.base/java.lang.invoke ' +
|
|
|
|
'java.base/java.security.cert java.base/java.security ' +
|
|
|
|
'java.base/javax.net.ssl java.base/java.util.concurrent ' +
|
|
|
|
'java.sql/java.sql'
|
|
|
|
)
|
|
|
|
}
|
2018-11-20 13:38:44 +00:00
|
|
|
}
|
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
enum ImageVariant {
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
UBUNTU_ZULU("Dockerfile", "17", "zulu-openjdk"),
|
|
|
|
AL_CORRETTO("DockerfileAL", "17", "amazonlinux2"),
|
2020-11-20 10:21:53 +00:00
|
|
|
OFFICIAL(UBUNTU_ZULU)
|
|
|
|
|
|
|
|
String dockerFile
|
|
|
|
String javaVersion
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
String baseImageFullName
|
2018-11-20 13:38:44 +00:00
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
ImageVariant(ImageVariant other) {
|
|
|
|
this.dockerFile = other.dockerFile
|
|
|
|
this.javaVersion = other.javaVersion
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
this.baseImageFullName = other.baseImageFullName
|
2020-11-20 10:21:53 +00:00
|
|
|
}
|
2019-12-16 14:34:51 +00:00
|
|
|
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
ImageVariant(String dockerFile, String javaVersion, String baseImageFullName) {
|
2020-11-20 10:21:53 +00:00
|
|
|
this.dockerFile = dockerFile
|
|
|
|
this.javaVersion = javaVersion
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
this.baseImageFullName = baseImageFullName
|
2019-12-16 14:34:51 +00:00
|
|
|
}
|
2020-11-20 10:21:53 +00:00
|
|
|
|
|
|
|
static final String getRepository(Project project) {
|
|
|
|
return project.properties.getOrDefault("docker.image.repository", "corda/corda")
|
2018-11-20 13:38:44 +00:00
|
|
|
}
|
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
Set<Identifier> buildTags(Project project) {
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
return ["${project.version.toString().toLowerCase()}-${baseImageFullName}"].stream().map {
|
2022-01-19 10:34:35 +00:00
|
|
|
toAppend -> "${getRepository(project)}:${toAppend}".toString()
|
2020-11-20 10:21:53 +00:00
|
|
|
}.map(Identifier.&fromCompoundString).collect(Collectors.toSet())
|
|
|
|
}
|
2019-09-18 09:26:26 +00:00
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
static Set<ImageVariant> toBeBuilt = Arrays.stream(values()).collect(Collectors.toSet())
|
2018-12-06 11:42:07 +00:00
|
|
|
}
|
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
class BuildDockerFolderTask extends DefaultTask {
|
2018-12-06 11:42:07 +00:00
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
@Option(option = "image", description = "Docker image variants that will be built")
|
|
|
|
void setVariants(List<ImageVariant> variants) {
|
|
|
|
ImageVariant.toBeBuilt = new HashSet<>(variants)
|
|
|
|
}
|
|
|
|
|
|
|
|
@OptionValues("image")
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
Collection<ImageVariant> getAllVariants() {
|
2020-11-20 10:21:53 +00:00
|
|
|
return EnumSet.allOf(ImageVariant.class)
|
|
|
|
}
|
|
|
|
|
|
|
|
@Input
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
Iterable<ImageVariant> getVariantsToBuild() {
|
2020-11-20 10:21:53 +00:00
|
|
|
return ImageVariant.toBeBuilt
|
|
|
|
}
|
|
|
|
|
|
|
|
@InputFiles
|
|
|
|
FileCollection getDockerBuildFiles() {
|
|
|
|
return project.fileTree("${project.projectDir}/src/docker/build")
|
|
|
|
}
|
|
|
|
|
|
|
|
@InputFiles
|
|
|
|
FileCollection getShellScripts() {
|
|
|
|
return project.fileTree("${project.projectDir}/src/bash")
|
|
|
|
}
|
|
|
|
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
private File cordaJar = project.findProject(":node:capsule").tasks.buildCordaJAR.outputs.files.filter {
|
|
|
|
it.name.contains("corda")
|
|
|
|
}.singleFile
|
2020-11-20 10:21:53 +00:00
|
|
|
|
|
|
|
private File configExporter = project.tasks.shadowJar.outputs.files.singleFile
|
|
|
|
|
|
|
|
private FileCollection getRequiredArtifacts() {
|
|
|
|
FileCollection res = project.tasks.shadowJar.outputs.files
|
|
|
|
def capsuleProject = project.findProject(":node:capsule")
|
|
|
|
def capsuleTaksOutput = capsuleProject.tasks.buildCordaJAR.outputs.files
|
|
|
|
res += capsuleTaksOutput
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
|
|
|
|
@OutputFiles
|
|
|
|
FileCollection getDockerFiles() {
|
|
|
|
return project.objects.fileCollection().from(ImageVariant.toBeBuilt.stream().map {
|
|
|
|
new File(dockerBuildDir, it.dockerFile)
|
|
|
|
}.collect(Collectors.toList()))
|
|
|
|
}
|
|
|
|
|
|
|
|
@OutputDirectory
|
|
|
|
final File dockerBuildDir = project.file("${project.buildDir}/docker/build")
|
|
|
|
|
|
|
|
@TaskAction
|
|
|
|
def run() {
|
|
|
|
for(ImageVariant imageVariant : ImageVariant.toBeBuilt) {
|
|
|
|
def sourceFile = project.projectDir.toPath().resolve("src/docker/${imageVariant.dockerFile}")
|
|
|
|
def destinationFile = dockerBuildDir.toPath().resolve(imageVariant.dockerFile)
|
|
|
|
Files.copy(sourceFile, destinationFile, StandardCopyOption.REPLACE_EXISTING)
|
|
|
|
}
|
|
|
|
Files.copy(cordaJar.toPath(), dockerBuildDir.toPath().resolve("corda.jar"), StandardCopyOption.REPLACE_EXISTING)
|
|
|
|
Files.copy(configExporter.toPath(), dockerBuildDir.toPath().resolve("config-exporter.jar"), StandardCopyOption.REPLACE_EXISTING)
|
2018-12-06 11:42:07 +00:00
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
["src/bash/run-corda.sh",
|
|
|
|
"src/config/starting-node.conf",
|
|
|
|
"src/bash/generate-config.sh"].forEach {
|
|
|
|
def source = project.file(it).toPath()
|
|
|
|
Files.copy(source, dockerBuildDir.toPath().resolve(source.fileName), StandardCopyOption.REPLACE_EXISTING)
|
|
|
|
}
|
|
|
|
}
|
2019-09-18 09:26:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
|
|
|
|
class BuildDockerImageTask extends DefaultTask {
|
|
|
|
|
|
|
|
@Option(option = "image", description = "Docker image variants that will be built")
|
|
|
|
void setVariants(List<ImageVariant> variants) {
|
|
|
|
ImageVariant.toBeBuilt = new HashSet<>(variants)
|
|
|
|
}
|
|
|
|
|
|
|
|
@OptionValues("image")
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
Collection<ImageVariant> getAllVariants() {
|
2020-11-20 10:21:53 +00:00
|
|
|
return EnumSet.allOf(ImageVariant.class)
|
|
|
|
}
|
|
|
|
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
@OutputDirectory
|
2020-11-20 10:21:53 +00:00
|
|
|
final File dockerBuildDir = project.file("${project.buildDir}/docker/build")
|
|
|
|
|
|
|
|
@OutputDirectory
|
|
|
|
final File dockerBuiltImageDir = project.file("${project.buildDir}/docker/images")
|
|
|
|
|
|
|
|
@Input
|
|
|
|
String getRepository() {
|
|
|
|
return ImageVariant.getRepository(project)
|
|
|
|
}
|
|
|
|
|
|
|
|
@InputFiles
|
|
|
|
FileCollection dockerFiles
|
|
|
|
|
|
|
|
private Map<ImageVariant, DockerImage> images
|
|
|
|
|
|
|
|
@OutputFiles
|
|
|
|
FileCollection getImageFiles() {
|
|
|
|
return project.objects.fileCollection().from(ImageVariant.toBeBuilt.stream().map { imageVariant ->
|
|
|
|
dockerBuiltImageDir.toPath().resolve(imageVariant.toString()).toFile()
|
|
|
|
}.collect(Collectors.toList()))
|
|
|
|
}
|
|
|
|
|
|
|
|
void from(BuildDockerFolderTask buildDockerFolderTask) {
|
|
|
|
dockerFiles = buildDockerFolderTask.outputs.files
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
Task configure(Closure closure) {
|
|
|
|
return super.configure(closure)
|
|
|
|
}
|
|
|
|
|
|
|
|
@TaskAction
|
|
|
|
def run() {
|
|
|
|
this.@images = ImageVariant.toBeBuilt.stream().map { imageVariant ->
|
|
|
|
new Tuple2<>(imageVariant, new DockerImage(
|
|
|
|
baseDir: dockerBuildDir,
|
|
|
|
dockerFile: imageVariant.dockerFile,
|
|
|
|
tags: imageVariant.buildTags(project)))
|
|
|
|
}.collect(Collectors.toMap({it.first}, {it.second}))
|
|
|
|
DockerUtils.buildImages(project, this.@images.values())
|
|
|
|
images.entrySet().forEach { entry ->
|
|
|
|
ImageVariant imageVariant = entry.key
|
|
|
|
def destinationFile = dockerBuiltImageDir.toPath().resolve(imageVariant.toString())
|
|
|
|
new ObjectOutputStream(Files.newOutputStream(destinationFile)).withStream {
|
|
|
|
it.writeObject(entry.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-18 09:26:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
class PushDockerImage extends DefaultTask {
|
|
|
|
@Option(option = "image", description = "Docker image variants that will be built")
|
|
|
|
void setVariants(List<ImageVariant> variants) {
|
|
|
|
ImageVariant.toBeBuilt = new HashSet<>(variants)
|
|
|
|
}
|
|
|
|
|
|
|
|
@OptionValues("image")
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
Collection<ImageVariant> getAllVariants() {
|
2020-11-20 10:21:53 +00:00
|
|
|
return EnumSet.allOf(ImageVariant.class)
|
|
|
|
}
|
|
|
|
|
|
|
|
private static String registryURL
|
|
|
|
|
|
|
|
@Option(option = "registry-url", description = "Docker image registry where images will be pushed, defaults to DockerHub")
|
|
|
|
void setRegistryURL(String registryURL) {
|
|
|
|
PushDockerImage.registryURL = registryURL
|
|
|
|
}
|
|
|
|
|
|
|
|
@InputFiles
|
|
|
|
FileCollection imageFiles
|
|
|
|
|
|
|
|
def from(BuildDockerImageTask buildDockerImageTask) {
|
|
|
|
imageFiles = buildDockerImageTask.outputs.files
|
|
|
|
}
|
|
|
|
|
|
|
|
@TaskAction
|
|
|
|
def run() {
|
|
|
|
def classLoader = DockerImage.class.classLoader
|
|
|
|
Stream<DockerImage> imageStream = imageFiles.files.stream().filter{
|
|
|
|
it.isFile()
|
|
|
|
}.map {
|
|
|
|
new ObjectInputStreamWithCustomClassLoader(Files.newInputStream(it.toPath()), classLoader).withStream {
|
|
|
|
DockerImage image = it.readObject()
|
|
|
|
if(PushDockerImage.registryURL) {
|
|
|
|
image.destination = PushDockerImage.registryURL
|
|
|
|
}
|
|
|
|
image
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DockerUtils.pushImages(project, imageStream)
|
|
|
|
}
|
2018-12-03 16:25:34 +00:00
|
|
|
}
|
|
|
|
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
def buildDockerFolderTask = tasks.register("buildDockerFolder", BuildDockerFolderTask) {
|
|
|
|
dependsOn = [ tasks.named('shadowJar') ]
|
|
|
|
}
|
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
def buildDockerImageTask = tasks.register("buildDockerImage", BuildDockerImageTask) {
|
|
|
|
from(buildDockerFolderTask.get())
|
2018-12-03 16:25:34 +00:00
|
|
|
}
|
|
|
|
|
2020-11-20 10:21:53 +00:00
|
|
|
tasks.register("pushDockerImage", PushDockerImage) {
|
|
|
|
from(buildDockerImageTask.get())
|
Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
the bouncycastle (i2p) implementation. This PR removes the conflicting
algorithms from the built-in JCE provider.
2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
scripting to conditionally output additional diagnostic info if the MDC
was populated. This PR has removed the scripting.
3. The artifactory plug-ins used are now deprecated, this PR has removed them
and uses the same code as Corda 5 for publishing to artifactory.
4. Javadoc generation has been modified to use the latest dokka plug-ins.
5. Gradle 7.6 has implemented an incredibly annoying change where transitive
dependencies are not put on the compile classpath, so that they have to be
explicitly added as dependencies to projects.
6. Mockito has been updated, which sadly meant that quite a few source files
have to changes to use the new (org.mockito.kotlin) package name. This makes
this PR appear much larger than it is.
7. A number of tests have been marked as ignored to get a green, broadly they fall
into 3 classes.
The first is related to crypto keypair tests, it appears some logic
in the JDK prefers to use the SunJCE implementation and we prefer to use
bouncycastle. I believe this issue can be fixed with better test setup.
The second group is related to our use of a method called "uncheckedCast(..)",
the purpose of this method was to get rid of the annoying unchecked cast compiler
warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
inference differs and at runtime sometimes the type it infers is "Void" which causes
an exception at runtime. The simplest solution is to use an explicit cast instead of
unchecked cast, Corda 5 have removed unchecked cast from their codebase.
The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-03-08 12:19:05 +00:00
|
|
|
}
|