From 643a22578a3bb5d5074eda9284c3f088a95e0336 Mon Sep 17 00:00:00 2001
From: Mike Aizatsky <mike.aizatsky@gmail.com>
Date: Thu, 3 Nov 2016 13:50:21 -0700
Subject: [PATCH] writing src entry

---
 infra/libfuzzer-pipeline.groovy | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/infra/libfuzzer-pipeline.groovy b/infra/libfuzzer-pipeline.groovy
index 7413d975f..f880e05bc 100644
--- a/infra/libfuzzer-pipeline.groovy
+++ b/infra/libfuzzer-pipeline.groovy
@@ -73,8 +73,14 @@ def call(body) {
             }
 
             sh "docker build --no-cache -t $dockerTag -f $dockerfile $dockerContextDir"
-            sh "docker run --rm $dockerTag srcmap > $srcmapFile"
-            def srcmap = new groovy.json.JsonSlurper().parse(new File(srcmapFile))
+            sh "docker run --rm $dockerTag srcmap > $workspace/srcmap.json.tmp"
+            def srcmap = new groovy.json.JsonSlurper().parse(
+                new File("$workspace/srcmap.json.tmp"))
+            srmap['/src'] = [ type: 'git',
+                              rev: ossfuzzRev,
+                              url: 'https://github.com/google/oss-fuzz.git',
+                              path: "targets/$projectName"]
+            writeFile file: srcmapFile text: groovy.json.JsonOutput.toJson(srcmap)
             echo "srcmap: $srcmap"
         } // stage("docker image")