8217357: Implement JCov jib profiles
authorshurailine
Tue, 22 Jan 2019 03:32:47 -0800
changeset 53423 1ae823617395
parent 53422 6f02e036630e
child 53430 ccfd4e614bb8
8217357: Implement JCov jib profiles Reviewed-by: erikj
make/conf/jib-profiles.js
--- a/make/conf/jib-profiles.js	Tue Jan 22 16:39:52 2019 +0000
+++ b/make/conf/jib-profiles.js	Tue Jan 22 03:32:47 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/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
@@ -574,6 +574,20 @@
             profiles[bootcyclePrebuiltName].default_make_targets = [ "product-images" ];
         });
 
+    // JCov profiles build JCov-instrumented JDK image based on images provided through dependencies.
+    [ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
+        .forEach(function (name) {
+            var jcovName = name + "-jcov";
+            profiles[jcovName] = clone(common.main_profile_base);
+            profiles[jcovName].target_os = profiles[name].target_os
+            profiles[jcovName].target_cpu = profiles[name].target_cpu
+            profiles[jcovName].default_make_targets = [ "jcov-bundles" ];
+            profiles[jcovName].dependencies = concat(profiles[jcovName].dependencies,
+                [ name + ".jdk", "devkit" ]);
+            profiles[jcovName].configure_args = concat(profiles[jcovName].configure_args,
+                ["--with-jcov-input-jdk=" + input.get(name + ".jdk", "home_path")]);
+        });
+
     //
     // Define artifacts for profiles
     //
@@ -707,6 +721,26 @@
         });
     });
 
+    // Artifacts of JCov profiles
+    [ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
+        .forEach(function (name) {
+            var o = artifactData[name]
+            var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
+            var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
+            var pf = o.platform
+            var jcovName = name + "-jcov";
+            profiles[jcovName].artifacts = {
+                jdk: {
+                    local: "bundles/\\(jdk-jcov.*bin." + jdk_suffix + "\\)",
+                    remote: [
+                        "bundles/" + pf + "/jdk-jcov-" + data.version + "_" + pf + "_bin." + jdk_suffix
+                    ],
+                    subdir: jdk_subdir,
+                    exploded: "images/jdk-jcov"
+                }
+            };
+        });
+
     // Profiles used to run tests.
     var testOnlyProfiles = {
         "run-test": {