[jps-cache] Remove publication of JSON files

GitOrigin-RevId: 2487642bfb072741b3360fbd8bd0ff298c744178
This commit is contained in:
Mikhail Mazurkevich
2020-05-05 12:33:11 +00:00
committed by intellij-monorepo-bot
parent d77a60e8a7
commit c3b5b5c325
2 changed files with 6 additions and 18 deletions
@@ -29,7 +29,6 @@ class CompilationOutputsUploader {
private static final String COMMIT_HISTORY_FILE = "commit_history.json"
private static final int COMMITS_LIMIT = 200
private final String agentPersistentStorage
private final CompilationContext context
private final BuildMessages messages
private final String remoteCacheUrl
@@ -53,9 +52,8 @@ class CompilationOutputsUploader {
return commitHashBuilder.toString()
}()
CompilationOutputsUploader(CompilationContext context, String remoteCacheUrl, Map<String, String> remotePerCommitHash,
String agentPersistentStorage, String tmpDir, boolean updateCommitHistory) {
this.agentPersistentStorage = agentPersistentStorage
CompilationOutputsUploader(CompilationContext context, String remoteCacheUrl, Map<String, String> remotePerCommitHash, String tmpDir,
boolean updateCommitHistory) {
this.tmpDir = tmpDir
this.remoteCacheUrl = remoteCacheUrl
this.messages = context.messages
@@ -100,11 +98,6 @@ class CompilationOutputsUploader {
messages.reportStatisticValue("Total outputs", String.valueOf(sourcesStateProcessor.getAllCompilationOutputs(currentSourcesState).size()))
messages.reportStatisticValue("Uploaded outputs", String.valueOf(uploadedOutputsCount.get()))
// Publish metadata file
def metadataFile = new File("$agentPersistentStorage/metadata.json")
FileUtil.rename(sourceStateFile, metadataFile)
messages.artifactBuilt(metadataFile.absolutePath)
if (updateCommitHistory) {
updateCommitHistory(uploader)
}
@@ -208,12 +201,9 @@ class CompilationOutputsUploader {
// Upload and publish file with commits history
def jsonAsString = new Gson().toJson(commitHistory)
def file = new File("$agentPersistentStorage/$COMMIT_HISTORY_FILE")
file.write(jsonAsString)
messages.artifactBuilt(file.absolutePath)
uploader.upload(COMMIT_HISTORY_FILE, file)
File commitHistoryFileCopy = new File(tmpDir, COMMIT_HISTORY_FILE)
FileUtil.rename(file, commitHistoryFileCopy)
File commitHistoryFile = new File(tmpDir, COMMIT_HISTORY_FILE)
commitHistoryFile.write(jsonAsString)
uploader.upload(COMMIT_HISTORY_FILE, commitHistoryFile)
}
@CompileStatic
@@ -107,7 +107,6 @@ class PortableCompilationCache {
else {
def remoteCacheUrl = require('intellij.jps.remote.cache.upload.url', "JPS remote cache upload url")
def syncFolder = require("jps.caches.aws.sync.folder", "AWS sync folder")
def agentPersistentStorage = require("agent.persistent.cache", "Agent persistent storage")
def commitHash = require("build.vcs.number", "Repository commit")
context.messages.buildStatus(commitHash)
def updateCommitHistory = System.getProperty('intellij.jps.remote.cache.updateHistory')?.toBoolean() ?: true
@@ -116,8 +115,7 @@ class PortableCompilationCache {
Map<String, String> remotePerCommitHash = [:]
remotePerCommitHash[remoteGitUrl] = commitHash
new CompilationOutputsUploader(
context, remoteCacheUrl, remotePerCommitHash,
agentPersistentStorage, syncFolder, updateCommitHistory
context, remoteCacheUrl, remotePerCommitHash, syncFolder, updateCommitHistory
).upload(publishTeamCityArtifacts)
}
}