Skip to content

Commit

Permalink
Download scanners if they're not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
asafgabai committed Nov 9, 2023
1 parent f596b37 commit 3843ce1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
8 changes: 2 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,12 @@ repositories {
}

def buildInfoVersion = '2.41.6'
def idePluginsCommonVersion = '2.3.0'
def idePluginsCommonVersion = '2.3.1'

dependencies {
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.15.2'
implementation group: 'org.jfrog.buildinfo', name: 'build-info-extractor', version: buildInfoVersion
implementation('com.jfrog.ide:ide-plugins-common') {
version {
branch = 'air-gap-support'
}
}
implementation group: 'com.jfrog.ide', name: 'ide-plugins-common', version: idePluginsCommonVersion
implementation group: 'org.jfrog.buildinfo', name: 'build-info-client', version: buildInfoVersion
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.15.2'
implementation group: 'org.jfrog.buildinfo', name: 'build-info-api', version: buildInfoVersion
Expand Down
6 changes: 0 additions & 6 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,4 @@ pluginManagement {
}
}

sourceControl {
gitRepository("https://github.com/asafgabai/ide-plugins-common.git") {
producesModule("com.jfrog.ide:ide-plugins-common")
}
}

rootProject.name = 'jfrog-idea-plugin'
5 changes: 3 additions & 2 deletions src/main/java/com/jfrog/ide/idea/scan/ScanBinaryExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,15 @@ private void updateBinaryIfNeeded() throws IOException {
// Allow only one thread to check and update the binary at any time.
synchronized (downloadLock) {
LocalDateTime currentTime = LocalDateTime.now();
if (nextUpdateCheck != null && currentTime.isBefore(nextUpdateCheck)) {
boolean targetExists = Files.exists(binaryTargetPath);
if (targetExists && nextUpdateCheck != null && currentTime.isBefore(nextUpdateCheck)) {
return;
}
ServerConfig server = GlobalSettings.getInstance().getServerConfig();
String externalResourcesRepo = server.getExternalResourcesRepo();
ArtifactoryManagerBuilder artifactoryManagerBuilder = createManagerBuilder(StringUtils.isEmpty(externalResourcesRepo), server);
try (ArtifactoryManager artifactoryManager = artifactoryManagerBuilder.build()) {
if (Files.exists(binaryTargetPath)) {
if (targetExists) {
// Check for new version of the binary
try (FileInputStream archiveBinaryFile = new FileInputStream(archiveTargetPath.toFile())) {
String latestBinaryChecksum = getFileChecksumFromServer(artifactoryManager, externalResourcesRepo);
Expand Down

0 comments on commit 3843ce1

Please sign in to comment.