/* * Copyright (c) 2019, Amazon.com, Inc. or its affiliates. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Amazon designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ dependencies { compile project(path: ':openjdksrc', configuration: 'archives') } task copySource(type: Copy) { dependsOn project.configurations.compile from tarTree(project.configurations.compile.singleFile) into buildRoot } task configureBuild(type: Exec) { dependsOn copySource workingDir "$buildRoot" // Platform specific flags def command = ['bash', 'configure', "--with-boot-jdk=${project.getProperty('bootjdk_dir')}", "--with-freetype=${project.getProperty('freetype_dir')}"] // Common flags command += project.correttoCommonFlags commandLine command.flatten() } task executeBuild(type: Exec) { dependsOn configureBuild workingDir "$buildRoot" commandLine 'make', 'clean', 'images' } task importAmazonCacerts(type: Exec) { dependsOn executeBuild workingDir "${executeBuild.workingDir}/build/${project.jdkImageName}/images/j2sdk-image" // Default password for JSSE key store def keystore_password = "changeit" commandLine 'keytool', '-importkeystore', '-noprompt', '-srckeystore', "$buildRoot/amazon-cacerts", '-srcstorepass', keystore_password, '-destkeystore', "jre/lib/security/cacerts", '-deststorepass', keystore_password } task copyCacerts(type: Copy) { dependsOn importAmazonCacerts def imageDir = "${executeBuild.workingDir}/build/${project.jdkImageName}/images" from file("${imageDir}/j2sdk-image/jre/lib/security/cacerts") into file("${imageDir}/j2re-image/lib/security") } task copyImage() { dependsOn copyCacerts doLast { // Copy image copy { from "${executeBuild.workingDir}/build/${project.jdkImageName}/images" into "$buildRoot/build" } // Copy version.txt into JDK copy { from "$buildRoot" include "commitId.txt" include "version.txt" into "$buildRoot/build/j2sdk-image" } // Copy version.txt into JRE copy { from "$buildRoot" include "commitId.txt" include "version.txt" into "$buildRoot/build/j2re-image" } } } task packageDebugSymbols(type: Zip) { dependsOn copyImage archiveName = "unsigned-jdk-debugsymbols-image.${project.correttoArch}.zip" from ("$buildRoot/build/j2sdk-image") { include '**/*.diz' } } task packageJdk(type: Zip) { dependsOn packageDebugSymbols archiveName = "unsigned-jdk-image.${project.correttoArch}.zip" from("$buildRoot/build/j2sdk-image") { exclude '**/*.diz' } } task packageJre(type: Zip) { dependsOn copyImage archiveName = "unsigned-jre-image.${project.correttoArch}.zip" from "$buildRoot/build/j2re-image" } artifacts { archives packageJdk archives packageJre }