diff --git a/.github/qodana.yaml b/.github/qodana.yaml index 260ec529..9583bfd3 100644 --- a/.github/qodana.yaml +++ b/.github/qodana.yaml @@ -1,6 +1,6 @@ version: "1.0" linter: jetbrains/qodana-jvm:latest -projectJDK: 11 +projectJDK: "11" profile: name: qodana.recommended.full exclude: diff --git a/build.gradle.kts b/build.gradle.kts index 9c796c99..c994d478 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + fun properties(key: String) = providers.gradleProperty(key) fun environment(key: String) = providers.environmentVariable(key) diff --git a/changelog.sh b/changelog.sh index 4451e34c..dae4ee3f 100755 --- a/changelog.sh +++ b/changelog.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash +# +# Copyright 2021-2024 JetBrains s.r.o. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + previous_tag=0 for current_tag in $(git tag --sort=-creatordate) do diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 6745ff36..4379edd3 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + fun properties(key: String) = providers.gradleProperty(key) fun environment(key: String) = providers.environmentVariable(key) @@ -11,10 +27,17 @@ val kotlinVersion by extra(libs.versions.kotlin.get()) group = "org.jetbrains.qodana.common" version = "${properties("majorVersion").get()}.${properties("buildNumber").get()}" + kotlin { jvmToolchain(11) version = "2024.1.6" } + +tasks.register("jarSources") { + archiveClassifier.set("sources") + from(sourceSets.main.get().allSource) +} + publishing { publications { create("common") { @@ -22,6 +45,7 @@ publishing { artifactId = "cli" version = version.toString() from(components["java"]) + artifact(tasks["jarSources"]) pom { url.set("https://github.com/JetBrains/qodana-action") licenses { diff --git a/common/qodana.ts b/common/qodana.ts index 419fe585..5b406f9c 100644 --- a/common/qodana.ts +++ b/common/qodana.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // noinspection JSUnusedGlobalSymbols import {checksum, version} from './cli.json' import {createHash} from 'crypto' diff --git a/common/src/main/kotlin/org/jetbrains/qodana/cli/Checksums.kt b/common/src/main/kotlin/org/jetbrains/qodana/cli/Checksums.kt new file mode 100644 index 00000000..b4b149d8 --- /dev/null +++ b/common/src/main/kotlin/org/jetbrains/qodana/cli/Checksums.kt @@ -0,0 +1,38 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.qodana.cli + +// CHECKSUMS is a map of Qodana CLI versions binaries and their checksums. +// Note: the content of this file is generated by the build script. Do not modify it manually. +val CHECKSUMS = mapOf( + "2023.3.2" to mapOf( + "windows_x86_64" to "da666d34e60167461ed75ce69a8d0dced33255d7d0785c4a3cdc33419cada022", + "windows_arm64" to "4c7d2363bf0ffe1f7269dde4af03bb3b8586f8e213f1cb3bc3c77d1d9f4a0e90", + "linux_x86_64" to "71abcb82489daba6200b5791ee56058a2f8ad8a87f8bbdcd33e6180906e1e482", + "linux_arm64" to "47f86194e30a33a702971cbc33c78a38aa2e1af18eeccabe6d10a7a36451d43a", + "darwin_x86_64" to "72b85e7e5a28f49b553df9e8efcb789c2622c41694f06ad9f83833baf335c8c5", + "darwin_arm64" to "468178072a0ffbdb80d8305a88ef7b671d484205c20c043adc7c257ddc0032a4" + ), + "2024.1.6" to mapOf( + "windows_x86_64" to "cba8236cc8c650ecac61d543e744cb20e4763a26a075f37dc5909880de93b1f3", + "windows_arm64" to "b0547cd008959ca275d0a945e9ae025c4c9271cffa0e87ffaac883d164bf84e2", + "linux_x86_64" to "597d870f4c747d04d0280956306e2e7b9e003662d4600d93c1b69fcaffc2bb7b", + "linux_arm64" to "b127fc5fe46f5c197781ff0f30de4e4f68b3ba19c5748dcb87c3d1417a3d9f89", + "darwin_x86_64" to "847495bdeb8bffd2e13b0af8decdbd3b7b23735ad18746d0629e7a5e25c867de", + "darwin_arm64" to "e87ff91a64b8c77466938ee2020bf8636b46016ff9b587aa3fcaa356d6de6b72" + ) +) \ No newline at end of file diff --git a/common/src/main/kotlin/org/jetbrains/qodana/cli/Qodana.kt b/common/src/main/kotlin/org/jetbrains/qodana/cli/Qodana.kt index 123fe861..30bc2a9c 100644 --- a/common/src/main/kotlin/org/jetbrains/qodana/cli/Qodana.kt +++ b/common/src/main/kotlin/org/jetbrains/qodana/cli/Qodana.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.qodana.cli import java.io.File @@ -14,25 +30,23 @@ import java.util.logging.Logger @Suppress("MemberVisibilityCanBePrivate") class Installer { val log: Logger = Logger.getLogger(Installer::class.java.name) + companion object { - private const val VERSION = "2024.1.6" - private const val RELEASE_DOWNLOAD_URL = "https://github.com/JetBrains/qodana-cli/releases/download/v%s/qodana_%s_%s" - private val CHECKSUMS = mapOf( - "windows_x86_64" to "cba8236cc8c650ecac61d543e744cb20e4763a26a075f37dc5909880de93b1f3", - "windows_arm64" to "b0547cd008959ca275d0a945e9ae025c4c9271cffa0e87ffaac883d164bf84e2", - "linux_x86_64" to "597d870f4c747d04d0280956306e2e7b9e003662d4600d93c1b69fcaffc2bb7b", - "linux_arm64" to "b127fc5fe46f5c197781ff0f30de4e4f68b3ba19c5748dcb87c3d1417a3d9f89", - "darwin_x86_64" to "847495bdeb8bffd2e13b0af8decdbd3b7b23735ad18746d0629e7a5e25c867de", - "darwin_arm64" to "e87ff91a64b8c77466938ee2020bf8636b46016ff9b587aa3fcaa356d6de6b72" - ) - - fun getQodanaUrl(platform: String = getPlatformName(), arch: String = getArchName(), version: String = VERSION): String { + private const val LATEST_VERSION = "2024.1.6" + private const val RELEASE_DOWNLOAD_URL = + "https://github.com/JetBrains/qodana-cli/releases/download/v%s/qodana_%s_%s" + + fun getQodanaUrl( + platform: String = getPlatformName(), + arch: String = getArchName(), + version: String = LATEST_VERSION + ): String { return String.format(RELEASE_DOWNLOAD_URL, version, platform, arch) + getExtension() } fun getExtension(): String = if (getPlatformName() == "windows") ".exe" else "" - fun getVersion(): String = VERSION + fun getLatestVersion(): String = LATEST_VERSION fun getArchName(): String { val arch = System.getProperty("os.arch").lowercase() @@ -53,20 +67,21 @@ class Installer { } } - fun getChecksum(): String { + fun getChecksum(version: String = getLatestVersion()): String { val platform = getPlatformName() val arch = getArchName() - return CHECKSUMS["${platform}_${arch}"] - ?: throw IllegalArgumentException("Unsupported combination of platform and architecture: ${platform}_${arch}") + return CHECKSUMS[version]?.get("${platform}_${arch}") + ?: throw IllegalArgumentException("Unsupported combination of version, platform and architecture: $version ${platform}_${arch}") } } - fun setup(path: File, downloadURL: String = getQodanaUrl()): String { + fun setup(path: File, downloadURL: String = getQodanaUrl(), version: String = getLatestVersion()): String { if (path.exists()) { + verifyChecksum(path, getChecksum(version)) return path.absolutePath } else try { download(downloadURL, path) - verifyChecksum(path, getChecksum()) + verifyChecksum(path, getChecksum(version)) } catch (e: IOException) { throw IOException("Unable to download latest qodana binary", e) } diff --git a/common/update-cli.js b/common/update-cli.js index c5ab637f..fec27368 100644 --- a/common/update-cli.js +++ b/common/update-cli.js @@ -1,199 +1,210 @@ const fs = require("fs"); const http = require("http"); const https = require("https"); -const { createHash } = require("crypto"); -const { readFileSync } = require("fs"); -const { execSync } = require("child_process"); +const {createHash} = require("crypto"); +const {readFileSync} = require("fs"); +const {execSync} = require("child_process"); const path = require("path"); const cliJsonPath = "./cli.json"; +const checksumsKtPath = "../common/src/main/kotlin/org/jetbrains/qodana/cli/Checksums.kt"; const PLATFORMS = ["windows", "linux", "darwin"]; const ARCHS = ["x86_64", "arm64"]; function sha256sum(file) { - const hash = createHash("sha256"); - hash.update(readFileSync(file)); - return hash.digest("hex"); + const hash = createHash("sha256"); + hash.update(readFileSync(file)); + return hash.digest("hex"); } function downloadFile(url, destinationPath) { - return new Promise((resolve, reject) => { - const protocol = url.startsWith("https") ? https : http; - - protocol.get(url, response => { - if (response.statusCode === 200) { - const file = fs.createWriteStream(destinationPath); - response.pipe(file); - file.on("finish", () => { - file.close(resolve); + return new Promise((resolve, reject) => { + const protocol = url.startsWith("https") ? https : http; + + protocol.get(url, response => { + if (response.statusCode === 200) { + const file = fs.createWriteStream(destinationPath); + response.pipe(file); + file.on("finish", () => { + file.close(resolve); + }); + } else if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) { + downloadFile(response.headers.location, destinationPath) + .then(resolve) + .catch(reject); + } else { + reject(new Error(`Failed to download file. Status code: ${response.statusCode}`)); + } + }).on("error", err => { + fs.unlink(destinationPath, () => { + }); + reject(err); }); - } else if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) { - downloadFile(response.headers.location, destinationPath) - .then(resolve) - .catch(reject); - } else { - reject(new Error(`Failed to download file. Status code: ${response.statusCode}`)); - } - }).on("error", err => { - fs.unlink(destinationPath, () => { - }); - reject(err); }); - }); } function makeRequest(options) { - return new Promise((resolve, reject) => { - const req = https.request(options, (res) => { - let data = ""; - res.on("data", (chunk) => { - data += chunk; - }); - res.on("end", () => { - if (res.statusCode >= 200 && res.statusCode <= 299) { - resolve(JSON.parse(data)); - } else { - reject(new Error(`Request failed with status code ${res.statusCode}`)); - } - }); - }); + return new Promise((resolve, reject) => { + const req = https.request(options, (res) => { + let data = ""; + res.on("data", (chunk) => { + data += chunk; + }); + res.on("end", () => { + if (res.statusCode >= 200 && res.statusCode <= 299) { + resolve(JSON.parse(data)); + } else { + reject(new Error(`Request failed with status code ${res.statusCode}`)); + } + }); + }); - req.on("error", (error) => { - reject(error); - }); + req.on("error", (error) => { + reject(error); + }); - req.end(); - }); + req.end(); + }); } -// Function to get the latest release async function getLatestRelease() { - try { - const options = { - hostname: "api.github.com", - path: `/repos/jetbrains/qodana-cli/releases/latest`, - headers: { - "User-Agent": "request", - "Accept": "application/vnd.github.v3+json" - } - }; - - const release = await makeRequest(options); - return release.tag_name.substring(1); - } catch (error) { - console.error("An error occurred:", error); - } + try { + const options = { + hostname: "api.github.com", + path: `/repos/jetbrains/qodana-cli/releases/latest`, + headers: { + "User-Agent": "request", + "Accept": "application/vnd.github.v3+json" + } + }; + + const release = await makeRequest(options); + return release.tag_name.substring(1); + } catch (error) { + console.error("An error occurred:", error); + } } function updateCliChecksums(latestVersion, checksumsPath, cliJsonPath) { - const cliJson = JSON.parse(fs.readFileSync(cliJsonPath, "utf-8")); - const allowedKeysfromCliJson = ["windows_x86_64", "windows_arm64", "linux_x86_64", "linux_arm64", "darwin_x86_64", "darwin_arm64"]; - const checksums = fs.readFileSync(checksumsPath, "utf-8"); - checksums.split("\n").forEach(line => { - const [checksum, filename] = line.trim().split(" "); - - if (checksum && filename) { - const key = filename.split("_").slice(1).join("_").split(".")[0]; - if (allowedKeysfromCliJson.includes(key)) { - cliJson.checksum[key] = checksum; - } - } - }); - cliJson.version = latestVersion; - fs.writeFileSync(cliJsonPath, JSON.stringify(cliJson, null, 2)); - fs.unlinkSync(checksumsPath); + const cliJson = JSON.parse(fs.readFileSync(cliJsonPath, "utf-8")); + const allowedKeysfromCliJson = ["windows_x86_64", "windows_arm64", "linux_x86_64", "linux_arm64", "darwin_x86_64", "darwin_arm64"]; + const checksums = fs.readFileSync(checksumsPath, "utf-8"); + checksums.split("\n").forEach(line => { + const [checksum, filename] = line.trim().split(" "); + + if (checksum && filename) { + const key = filename.split("_").slice(1).join("_").split(".")[0]; + if (allowedKeysfromCliJson.includes(key)) { + cliJson.checksum[key] = checksum; + } + } + }); + cliJson.version = latestVersion; + fs.writeFileSync(cliJsonPath, JSON.stringify(cliJson, null, 2)); + fs.unlinkSync(checksumsPath); } function updateCircleCIChecksums(circleCIConfigPath) { - let circleCIConfig = fs.readFileSync(circleCIConfigPath, "utf-8"); - execSync("curl -fSsL https://github.com/jetbrains/qodana-cli/releases/latest/download/qodana_linux_x86_64.tar.gz -o qodana_linux_x86_64.tar.gz"); - execSync("mkdir qodana && tar -xzf qodana_linux_x86_64.tar.gz -C qodana"); - const checksum = sha256sum("qodana/qodana"); - const circleCIConfigLines = circleCIConfig.split("\n"); - circleCIConfigLines[55] = ` QODANA_SHA_256=${checksum}`; - circleCIConfig = circleCIConfigLines.join("\n"); - fs.writeFileSync(circleCIConfigPath, circleCIConfig); - execSync("rm -rf qodana/ qodana_linux_x86_64.tar.gz"); + let circleCIConfig = fs.readFileSync(circleCIConfigPath, "utf-8"); + execSync("curl -fSsL https://github.com/jetbrains/qodana-cli/releases/latest/download/qodana_linux_x86_64.tar.gz -o qodana_linux_x86_64.tar.gz"); + execSync("mkdir qodana && tar -xzf qodana_linux_x86_64.tar.gz -C qodana"); + const checksum = sha256sum("qodana/qodana"); + const circleCIConfigLines = circleCIConfig.split("\n"); + circleCIConfigLines[55] = ` QODANA_SHA_256=${checksum}`; + circleCIConfig = circleCIConfigLines.join("\n"); + fs.writeFileSync(circleCIConfigPath, circleCIConfig); + execSync("rm -rf qodana/ qodana_linux_x86_64.tar.gz"); } -function updateQodanaKtChecksums(checksums) { - const qodanaKtPath = "../src/main/kotlin/org/jetbrains/qodana/Qodana.kt"; - let qodanaKtContent = fs.readFileSync(qodanaKtPath, "utf-8"); +function updateChecksumsKtFile(checksums, latestVersion) { + let checksumsKtContent = fs.readFileSync(checksumsKtPath, "utf-8"); - const newChecksums = `private val CHECKSUMS = mapOf(\n` + - checksums.map(({ platform, arch, checksum }) => ` "${platform}_${arch}" to "${checksum}"`).join(",\n") + - "\n )"; + const newChecksums = ` "${latestVersion}" to mapOf(\n` + + checksums.map(({platform, arch, checksum}) => ` "${platform}_${arch}" to "${checksum}"`).join(",\n") + + "\n )"; - qodanaKtContent = qodanaKtContent.replace(/private val CHECKSUMS = mapOf\((.|\n)*?\)/, newChecksums); - fs.writeFileSync(qodanaKtPath, qodanaKtContent); + const checksumSectionRegex = /val CHECKSUMS = mapOf\((.|\n)*?\)/; + const match = checksumSectionRegex.exec(checksumsKtContent); + + if (match) { + const newContent = match[0].replace(")", `,\n${newChecksums})`); + checksumsKtContent = checksumsKtContent.replace(checksumSectionRegex, newContent); + } else { + const newContent = `val CHECKSUMS = mapOf(\n${newChecksums}\n)`; + checksumsKtContent = checksumsKtContent.replace("val CHECKSUMS = mapOf()", newContent); + } + + fs.writeFileSync(checksumsKtPath, checksumsKtContent); } function updateVersions(latestVersion, currentVersion) { - const latestVersions = latestVersion.split("."); - const latestMajor = parseInt(latestVersions[0]); - const latestMinor = parseInt(latestVersions[1]); - const latestPatch = parseInt(latestVersions[2]); - - let taskJson = JSON.parse( - fs.readFileSync( - path.join(__dirname, "..", "vsts", "QodanaScan", "task.json"), - "utf8" - ) - ); - taskJson.version.Major = latestMajor; - taskJson.version.Minor = latestMinor; - taskJson.version.Patch = latestPatch; - fs.writeFileSync( - path.join(__dirname, "..", "vsts", "QodanaScan", "task.json"), - JSON.stringify(taskJson, null, 2) - ); - const currentVersions = currentVersion.split("."); - const currentMajor = parseInt(currentVersions[0]); - const currentMinor = parseInt(currentVersions[1]); - const currentPatch = parseInt(currentVersions[2]); - - replaceStringsInProject(`${latestMajor}.${latestMinor}.${latestPatch}`, `${currentMajor}.${currentMinor}.${currentPatch}`); - replaceStringsInProject(`${latestMajor}.${latestMinor}`, `${currentMajor}.${currentMinor}`); - replaceStringsInProject(`${latestMajor}`, `${currentMajor}`); + const latestVersions = latestVersion.split("."); + const latestMajor = parseInt(latestVersions[0]); + const latestMinor = parseInt(latestVersions[1]); + const latestPatch = parseInt(latestVersions[2]); + + let taskJson = JSON.parse( + fs.readFileSync( + path.join(__dirname, "..", "vsts", "QodanaScan", "task.json"), + "utf8" + ) + ); + taskJson.version.Major = latestMajor; + taskJson.version.Minor = latestMinor; + taskJson.version.Patch = latestPatch; + fs.writeFileSync( + path.join(__dirname, "..", "vsts", "QodanaScan", "task.json"), + JSON.stringify(taskJson, null, 2) + ); + const currentVersions = currentVersion.split("."); + const currentMajor = parseInt(currentVersions[0]); + const currentMinor = parseInt(currentVersions[1]); + const currentPatch = parseInt(currentVersions[2]); + + replaceStringsInProject(`${latestMajor}.${latestMinor}.${latestPatch}`, `${currentMajor}.${currentMinor}.${currentPatch}`); + replaceStringsInProject(`${latestMajor}.${latestMinor}`, `${currentMajor}.${currentMinor}`); + replaceStringsInProject(`${latestMajor}`, `${currentMajor}`); } function replaceStringsInProject(newString, oldString) { - process.env.LC_ALL = "C"; - const isMacOS = process.platform === "darwin"; - const command = `cd .. && find . -type f -exec sed -i${isMacOS ? " ''" : ""} 's/${oldString}/${newString}/g' {} +`; - console.log("Running command:", command); - execSync(command, { shell: "/bin/bash" }); + process.env.LC_ALL = "C"; + const isMacOS = process.platform === "darwin"; + const command = `cd .. && find . -type f -not -path "./common/src/main/kotlin/org/jetbrains/qodana/cli/Checksums.kt" -exec sed -i${isMacOS ? " ''" : ""} 's/${oldString}/${newString}/g' {} +`; + console.log("Running command:", command); + execSync(command, {shell: "/bin/bash"}); } async function main() { - try { - const currentVersion = JSON.parse(fs.readFileSync(cliJsonPath, "utf-8")).version; - console.log("Current version:", currentVersion); - const latestVersion = await getLatestRelease(); - console.log("Latest version:", latestVersion); - console.log("Downloading new checksums..."); - await downloadFile(`https://github.com/jetbrains/qodana-cli/releases/latest/download/checksums.txt`, "checksums.txt"); - updateVersions(latestVersion, currentVersion); - updateCliChecksums(latestVersion, "checksums.txt", cliJsonPath); - updateCircleCIChecksums("../orb/commands/scan.yml"); - // Download binaries, calculate checksums, and update Qodana.kt - const checksums = []; - for (const platform of PLATFORMS) { - for (const arch of ARCHS) { - const url = `https://github.com/jetbrains/qodana-cli/releases/latest/download/qodana_${platform}_${arch}${platform === "windows" ? ".exe" : ""}`; - const filePath = path.join(__dirname, `qodana_${platform}_${arch}${platform === "windows" ? ".exe" : ""}`); - console.log(`Downloading ${url}...`); - await downloadFile(url, filePath); - const checksum = sha256sum(filePath); - checksums.push({ platform, arch, checksum }); - fs.unlinkSync(filePath); - } + try { + const currentVersion = JSON.parse(fs.readFileSync(cliJsonPath, "utf-8")).version; + console.log("Current version:", currentVersion); + const latestVersion = await getLatestRelease(); + console.log("Latest version:", latestVersion); + console.log("Downloading new checksums..."); + await downloadFile(`https://github.com/jetbrains/qodana-cli/releases/latest/download/checksums.txt`, "checksums.txt"); + updateVersions(latestVersion, currentVersion); + updateCliChecksums(latestVersion, "checksums.txt", cliJsonPath); + updateCircleCIChecksums("../orb/commands/scan.yml"); + + // Download binaries, calculate checksums, and update Checksums.kt + const checksums = []; + for (const platform of PLATFORMS) { + for (const arch of ARCHS) { + const url = `https://github.com/jetbrains/qodana-cli/releases/latest/download/qodana_${platform}_${arch}${platform === "windows" ? ".exe" : ""}`; + const filePath = path.join(__dirname, `qodana_${platform}_${arch}${platform === "windows" ? ".exe" : ""}`); + console.log(`Downloading ${url}...`); + await downloadFile(url, filePath); + const checksum = sha256sum(filePath); + checksums.push({platform, arch, checksum}); + fs.unlinkSync(filePath); + } + } + updateChecksumsKtFile(checksums, latestVersion); + + console.log("Checksums updated successfully"); + } catch (error) { + console.error(error); } - updateQodanaKtChecksums(checksums); - console.log("Versions updated successfully!"); - } catch (error) { - console.error("An error occurred:", error); - } } main(); diff --git a/gradle.properties b/gradle.properties index 86e68217..fd88458d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,19 @@ +# +# Copyright 2021-2024 JetBrains s.r.o. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + name=Qodana for Gradle projectGroup=org.jetbrains.qodana majorVersion=2024.1 diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 2c10b20f..a3a931b8 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + @file:Suppress("UnstableApiUsage") import org.jetbrains.dokka.gradle.DokkaTask diff --git a/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPlugin.kt b/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPlugin.kt index d90b9fbf..ea011f12 100644 --- a/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPlugin.kt +++ b/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPlugin.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.qodana import org.gradle.api.Plugin @@ -17,18 +33,20 @@ class QodanaPlugin : Plugin { } // `qodana {}` Extension - val extension = project.extensions.create(QodanaPluginConstants.EXTENSION_NAME, QodanaPluginExtension::class.java).also { ext -> - ext.projectPath.convention(project.projectDir.canonicalPath) - ext.resultsPath.convention(project.provider { - "${ext.projectPath.get()}/build/qodana/results" - }) - ext.cachePath.convention(project.provider { - "${ext.projectPath.get()}/build/qodana/cache" - }) - ext.qodanaPath.convention(project.provider { - "${ext.projectPath.get()}/build/qodana/${Installer.getVersion()}/qodana${Installer.getExtension()}" - }) - } + val extension = + project.extensions.create(QodanaPluginConstants.EXTENSION_NAME, QodanaPluginExtension::class.java) + .also { ext -> + ext.projectPath.convention(project.projectDir.canonicalPath) + ext.resultsPath.convention(project.provider { + "${ext.projectPath.get()}/build/qodana/results" + }) + ext.cachePath.convention(project.provider { + "${ext.projectPath.get()}/build/qodana/cache" + }) + ext.qodanaPath.convention(project.provider { + "${ext.projectPath.get()}/build/qodana/${Installer.getLatestVersion()}/qodana${Installer.getExtension()}" + }) + } // `qodanaScan` task project.tasks.register(QodanaPluginConstants.QODANA_SCAN_TASK_NAME, QodanaScanTask::class.java) { diff --git a/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPluginConstants.kt b/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPluginConstants.kt index f89640be..9dd956a8 100644 --- a/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPluginConstants.kt +++ b/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPluginConstants.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.qodana object QodanaPluginConstants { diff --git a/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPluginExtension.kt b/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPluginExtension.kt index 81dced20..3fe422b9 100644 --- a/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPluginExtension.kt +++ b/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPluginExtension.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.qodana import org.gradle.api.model.ObjectFactory diff --git a/plugin/src/main/kotlin/org/jetbrains/qodana/Version.kt b/plugin/src/main/kotlin/org/jetbrains/qodana/Version.kt index cfbca679..a9a3dd46 100644 --- a/plugin/src/main/kotlin/org/jetbrains/qodana/Version.kt +++ b/plugin/src/main/kotlin/org/jetbrains/qodana/Version.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.qodana class Version( diff --git a/plugin/src/main/kotlin/org/jetbrains/qodana/tasks/QodanaScanTask.kt b/plugin/src/main/kotlin/org/jetbrains/qodana/tasks/QodanaScanTask.kt index e30e93ec..89637a6d 100644 --- a/plugin/src/main/kotlin/org/jetbrains/qodana/tasks/QodanaScanTask.kt +++ b/plugin/src/main/kotlin/org/jetbrains/qodana/tasks/QodanaScanTask.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.qodana.tasks import org.apache.tools.ant.util.TeeOutputStream diff --git a/plugin/src/test/kotlin/org/jetbrains/qodana/BaseTest.kt b/plugin/src/test/kotlin/org/jetbrains/qodana/BaseTest.kt index 94223af3..e8e94ebc 100644 --- a/plugin/src/test/kotlin/org/jetbrains/qodana/BaseTest.kt +++ b/plugin/src/test/kotlin/org/jetbrains/qodana/BaseTest.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.qodana import org.gradle.api.internal.project.ProjectInternal diff --git a/plugin/src/test/kotlin/org/jetbrains/qodana/QodanaPluginTest.kt b/plugin/src/test/kotlin/org/jetbrains/qodana/QodanaPluginTest.kt index da816655..56caf28d 100644 --- a/plugin/src/test/kotlin/org/jetbrains/qodana/QodanaPluginTest.kt +++ b/plugin/src/test/kotlin/org/jetbrains/qodana/QodanaPluginTest.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.qodana import org.junit.Assume diff --git a/plugin/src/test/kotlin/org/jetbrains/qodana/tasks/QodanaScanTaskTest.kt b/plugin/src/test/kotlin/org/jetbrains/qodana/tasks/QodanaScanTaskTest.kt index f0337f51..26f64bb7 100644 --- a/plugin/src/test/kotlin/org/jetbrains/qodana/tasks/QodanaScanTaskTest.kt +++ b/plugin/src/test/kotlin/org/jetbrains/qodana/tasks/QodanaScanTaskTest.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.qodana.tasks import org.jetbrains.qodana.BaseTest diff --git a/scan/__tests__/main.test.ts b/scan/__tests__/main.test.ts index 922360c0..84e9394f 100644 --- a/scan/__tests__/main.test.ts +++ b/scan/__tests__/main.test.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import {expect, test} from '@jest/globals' import {AnnotationProperties} from '@actions/core' import { diff --git a/scan/__tests__/project.test.ts b/scan/__tests__/project.test.ts index 577892e8..d849ec07 100644 --- a/scan/__tests__/project.test.ts +++ b/scan/__tests__/project.test.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import {expect, test} from '@jest/globals' import { sha256sum, diff --git a/scan/jest.config.js b/scan/jest.config.js index c4946c5a..5e5d2b87 100644 --- a/scan/jest.config.js +++ b/scan/jest.config.js @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + module.exports = { clearMocks: true, moduleFileExtensions: ['js', 'ts'], diff --git a/scan/src/annotations.ts b/scan/src/annotations.ts index ec231fde..62970631 100644 --- a/scan/src/annotations.ts +++ b/scan/src/annotations.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /* eslint-disable @typescript-eslint/no-non-null-assertion,github/array-foreach */ import * as core from '@actions/core' import {AnnotationProperties} from '@actions/core' diff --git a/scan/src/main.ts b/scan/src/main.ts index 0a9ea803..f376b3cf 100644 --- a/scan/src/main.ts +++ b/scan/src/main.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as core from '@actions/core' import * as github from '@actions/github' import * as io from '@actions/io' diff --git a/scan/src/output.ts b/scan/src/output.ts index a657c4a9..8df031d4 100644 --- a/scan/src/output.ts +++ b/scan/src/output.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /* eslint-disable @typescript-eslint/no-non-null-assertion */ import * as core from '@actions/core' import * as fs from 'fs' diff --git a/scan/src/utils.ts b/scan/src/utils.ts index 652d1a15..9b13e62f 100644 --- a/scan/src/utils.ts +++ b/scan/src/utils.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as cache from '@actions/cache' import * as core from '@actions/core' import * as exec from '@actions/exec' diff --git a/settings.gradle.kts b/settings.gradle.kts index e755929a..54bfba86 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + rootProject.name = "qodana" pluginManagement { diff --git a/vsts/QodanaScan/index.js b/vsts/QodanaScan/index.js index be9bc25c..f2161bdb 100644 --- a/vsts/QodanaScan/index.js +++ b/vsts/QodanaScan/index.js @@ -4411,10 +4411,14 @@ var require_semver_compare = __commonJS({ for (var i = 0; i < 3; i++) { var na = Number(pa[i]); var nb = Number(pb[i]); - if (na > nb) return 1; - if (nb > na) return -1; - if (!isNaN(na) && isNaN(nb)) return 1; - if (isNaN(na) && !isNaN(nb)) return -1; + if (na > nb) + return 1; + if (nb > na) + return -1; + if (!isNaN(na) && isNaN(nb)) + return 1; + if (isNaN(na) && !isNaN(nb)) + return -1; } return 0; }; @@ -4935,7 +4939,8 @@ var require_utils2 = __commonJS({ "lib/utils.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; + if (k2 === void 0) + k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { @@ -4944,7 +4949,8 @@ var require_utils2 = __commonJS({ } Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; + if (k2 === void 0) + k2 = k; o[k2] = m[k]; }); var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { @@ -4953,10 +4959,13 @@ var require_utils2 = __commonJS({ o["default"] = v; }); var __importStar2 = exports2 && exports2.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; + if (mod && mod.__esModule) + return mod; var result = {}; if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding2(result, mod, k); } __setModuleDefault2(result, mod); return result; @@ -5101,7 +5110,8 @@ var require_utils2 = __commonJS({ // lib/main.js var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; + if (k2 === void 0) + k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { @@ -5110,7 +5120,8 @@ var __createBinding = exports && exports.__createBinding || (Object.create ? fun } Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; + if (k2 === void 0) + k2 = k; o[k2] = m[k]; }); var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { @@ -5119,10 +5130,13 @@ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create o["default"] = v; }); var __importStar = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) return mod; + if (mod && mod.__esModule) + return mod; var result = {}; if (mod != null) { - for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); } __setModuleDefault(result, mod); return result; diff --git a/vsts/src/main.ts b/vsts/src/main.ts index 7e49ace2..00bdd016 100644 --- a/vsts/src/main.ts +++ b/vsts/src/main.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as tl from 'azure-pipelines-task-lib/task' import { FAIL_THRESHOLD_OUTPUT, diff --git a/vsts/src/utils.ts b/vsts/src/utils.ts index 96b2bf71..327c50ae 100644 --- a/vsts/src/utils.ts +++ b/vsts/src/utils.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2021-2024 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as compress from 'azure-pipelines-tasks-utility-common/compressutility' import * as tl from 'azure-pipelines-task-lib/task' import * as tool from 'azure-pipelines-tool-lib'