Allow source files to contain lines up to 120 characters

This avoids excessive line-feeds when reformatting code to 80 char lines.
This commit is contained in:
Daz DeBoer 2021-10-29 07:34:44 -06:00
parent e3ada7e5c2
commit 063fc6a872
No known key found for this signature in database
GPG Key ID: DD6B9F0B06683D5D
8 changed files with 60 additions and 197 deletions

View File

@ -1,5 +1,5 @@
{ {
"printWidth": 80, "printWidth": 120,
"tabWidth": 4, "tabWidth": 4,
"useTabs": false, "useTabs": false,
"semi": false, "semi": false,

View File

@ -5,12 +5,7 @@ import * as core from '@actions/core'
import * as glob from '@actions/glob' import * as glob from '@actions/glob'
import * as exec from '@actions/exec' import * as exec from '@actions/exec'
import { import {AbstractCache, getCacheKeyPrefix, hashFileNames, tryDelete} from './cache-utils'
AbstractCache,
getCacheKeyPrefix,
hashFileNames,
tryDelete
} from './cache-utils'
const META_FILE_DIR = '.gradle-build-action' const META_FILE_DIR = '.gradle-build-action'
@ -46,27 +41,18 @@ export class GradleUserHomeCache extends AbstractCache {
await Promise.all(processes) await Promise.all(processes)
} }
private async restoreArtifactBundle( private async restoreArtifactBundle(bundle: string, artifactPath: string): Promise<void> {
bundle: string,
artifactPath: string
): Promise<void> {
const bundleMetaFile = this.getBundleMetaFile(bundle) const bundleMetaFile = this.getBundleMetaFile(bundle)
if (fs.existsSync(bundleMetaFile)) { if (fs.existsSync(bundleMetaFile)) {
const cacheKey = fs.readFileSync(bundleMetaFile, 'utf-8').trim() const cacheKey = fs.readFileSync(bundleMetaFile, 'utf-8').trim()
const restoreKey = await this.restoreCache([artifactPath], cacheKey) const restoreKey = await this.restoreCache([artifactPath], cacheKey)
if (restoreKey) { if (restoreKey) {
core.info( core.info(`Restored ${bundle} with key ${cacheKey} to ${artifactPath}`)
`Restored ${bundle} with key ${cacheKey} to ${artifactPath}`
)
} else { } else {
this.debug( this.debug(`Did not restore ${bundle} with key ${cacheKey} to ${artifactPath}`)
`Did not restore ${bundle} with key ${cacheKey} to ${artifactPath}`
)
} }
} else { } else {
this.debug( this.debug(`No metafile found to restore ${bundle}: ${bundleMetaFile}`)
`No metafile found to restore ${bundle}: ${bundleMetaFile}`
)
} }
} }
@ -84,12 +70,8 @@ export class GradleUserHomeCache extends AbstractCache {
} }
private removeExcludedPaths(): void { private removeExcludedPaths(): void {
const rawPaths: string[] = core.getMultilineInput( const rawPaths: string[] = core.getMultilineInput(EXCLUDE_PATHS_PARAMETER)
EXCLUDE_PATHS_PARAMETER const resolvedPaths = rawPaths.map(x => path.resolve(this.gradleUserHome, x))
)
const resolvedPaths = rawPaths.map(x =>
path.resolve(this.gradleUserHome, x)
)
for (const p of resolvedPaths) { for (const p of resolvedPaths) {
this.debug(`Deleting excluded path: ${p}`) this.debug(`Deleting excluded path: ${p}`)
@ -111,10 +93,7 @@ export class GradleUserHomeCache extends AbstractCache {
await Promise.all(processes) await Promise.all(processes)
} }
private async saveArtifactBundle( private async saveArtifactBundle(bundle: string, artifactPath: string): Promise<void> {
bundle: string,
artifactPath: string
): Promise<void> {
const bundleMetaFile = this.getBundleMetaFile(bundle) const bundleMetaFile = this.getBundleMetaFile(bundle)
const globber = await glob.create(artifactPath, { const globber = await glob.create(artifactPath, {
@ -138,9 +117,7 @@ export class GradleUserHomeCache extends AbstractCache {
const cacheKey = this.createCacheKey(bundle, bundleFiles) const cacheKey = this.createCacheKey(bundle, bundleFiles)
if (previouslyRestoredKey === cacheKey) { if (previouslyRestoredKey === cacheKey) {
this.debug( this.debug(`No change to previously restored ${bundle}. Not caching.`)
`No change to previously restored ${bundle}. Not caching.`
)
} else { } else {
core.info(`Caching ${bundle} with cache key: ${cacheKey}`) core.info(`Caching ${bundle} with cache key: ${cacheKey}`)
await this.saveCache([artifactPath], cacheKey) await this.saveCache([artifactPath], cacheKey)
@ -154,14 +131,10 @@ export class GradleUserHomeCache extends AbstractCache {
protected createCacheKey(bundle: string, files: string[]): string { protected createCacheKey(bundle: string, files: string[]): string {
const cacheKeyPrefix = getCacheKeyPrefix() const cacheKeyPrefix = getCacheKeyPrefix()
const relativeFiles = files.map(x => const relativeFiles = files.map(x => path.relative(this.gradleUserHome, x))
path.relative(this.gradleUserHome, x)
)
const key = hashFileNames(relativeFiles) const key = hashFileNames(relativeFiles)
this.debug( this.debug(`Generating cache key for ${bundle} from files: ${relativeFiles}`)
`Generating cache key for ${bundle} from files: ${relativeFiles}`
)
return `${cacheKeyPrefix}${bundle}-${key}` return `${cacheKeyPrefix}${bundle}-${key}`
} }
@ -193,9 +166,7 @@ export class GradleUserHomeCache extends AbstractCache {
} }
protected getCachePath(): string[] { protected getCachePath(): string[] {
const rawPaths: string[] = core.getMultilineInput( const rawPaths: string[] = core.getMultilineInput(INCLUDE_PATHS_PARAMETER)
INCLUDE_PATHS_PARAMETER
)
rawPaths.push(META_FILE_DIR) rawPaths.push(META_FILE_DIR)
const resolvedPaths = rawPaths.map(x => this.resolveCachePath(x)) const resolvedPaths = rawPaths.map(x => this.resolveCachePath(x))
this.debug(`Using cache paths: ${resolvedPaths}`) this.debug(`Using cache paths: ${resolvedPaths}`)
@ -211,19 +182,10 @@ export class GradleUserHomeCache extends AbstractCache {
} }
private getArtifactBundles(): Map<string, string> { private getArtifactBundles(): Map<string, string> {
const artifactBundleDefinition = core.getInput( const artifactBundleDefinition = core.getInput(ARTIFACT_BUNDLES_PARAMETER)
ARTIFACT_BUNDLES_PARAMETER this.debug(`Using artifact bundle definition: ${artifactBundleDefinition}`)
)
this.debug(
`Using artifact bundle definition: ${artifactBundleDefinition}`
)
const artifactBundles = JSON.parse(artifactBundleDefinition) const artifactBundles = JSON.parse(artifactBundleDefinition)
return new Map( return new Map(Array.from(artifactBundles, ([key, value]) => [key, path.resolve(this.gradleUserHome, value)]))
Array.from(artifactBundles, ([key, value]) => [
key,
path.resolve(this.gradleUserHome, value)
])
)
} }
private async reportGradleUserHomeSize(label: string): Promise<void> { private async reportGradleUserHomeSize(label: string): Promise<void> {
@ -233,15 +195,11 @@ export class GradleUserHomeCache extends AbstractCache {
if (!fs.existsSync(this.gradleUserHome)) { if (!fs.existsSync(this.gradleUserHome)) {
return return
} }
const result = await exec.getExecOutput( const result = await exec.getExecOutput('du', ['-h', '-c', '-t', '5M'], {
'du', cwd: this.gradleUserHome,
['-h', '-c', '-t', '5M'], silent: true,
{ ignoreReturnCode: true
cwd: this.gradleUserHome, })
silent: true,
ignoreReturnCode: true
}
)
core.info(`Gradle User Home (directories >5M): ${label}`) core.info(`Gradle User Home (directories >5M): ${label}`)

View File

@ -44,11 +44,7 @@ function generateCacheKey(cacheName: string): CacheKey {
// Exact match on Git SHA // Exact match on Git SHA
const cacheKey = `${cacheKeyForJobContext}-${github.context.sha}` const cacheKey = `${cacheKeyForJobContext}-${github.context.sha}`
return new CacheKey(cacheKey, [ return new CacheKey(cacheKey, [cacheKeyForJobContext, cacheKeyForJob, cacheKeyForOs])
cacheKeyForJobContext,
cacheKeyForJob,
cacheKeyForOs
])
} }
function determineJobContext(): string { function determineJobContext(): string {
@ -66,9 +62,7 @@ export function hashStrings(values: string[]): string {
} }
export function hashFileNames(fileNames: string[]): string { export function hashFileNames(fileNames: string[]): string {
return hashStrings( return hashStrings(fileNames.map(x => x.replace(new RegExp(`\\${path.sep}`, 'g'), '/')))
fileNames.map(x => x.replace(new RegExp(`\\${path.sep}`, 'g'), '/'))
)
} }
/** /**
@ -127,9 +121,7 @@ export abstract class AbstractCache {
async restore(): Promise<void> { async restore(): Promise<void> {
if (this.cacheOutputExists()) { if (this.cacheOutputExists()) {
core.info( core.info(`${this.cacheDescription} already exists. Not restoring from cache.`)
`${this.cacheDescription} already exists. Not restoring from cache.`
)
return return
} }
@ -143,31 +135,21 @@ export abstract class AbstractCache {
restoreKeys:[${cacheKey.restoreKeys}]` restoreKeys:[${cacheKey.restoreKeys}]`
) )
const cacheResult = await this.restoreCache( const cacheResult = await this.restoreCache(this.getCachePath(), cacheKey.key, cacheKey.restoreKeys)
this.getCachePath(),
cacheKey.key,
cacheKey.restoreKeys
)
if (!cacheResult) { if (!cacheResult) {
core.info( core.info(`${this.cacheDescription} cache not found. Will start with empty.`)
`${this.cacheDescription} cache not found. Will start with empty.`
)
return return
} }
core.saveState(this.cacheResultStateKey, cacheResult) core.saveState(this.cacheResultStateKey, cacheResult)
core.info( core.info(`Restored ${this.cacheDescription} from cache key: ${cacheResult}`)
`Restored ${this.cacheDescription} from cache key: ${cacheResult}`
)
try { try {
await this.afterRestore() await this.afterRestore()
} catch (error) { } catch (error) {
core.warning( core.warning(`Restore ${this.cacheDescription} failed in 'afterRestore': ${error}`)
`Restore ${this.cacheDescription} failed in 'afterRestore': ${error}`
)
} }
return return
@ -179,11 +161,7 @@ export abstract class AbstractCache {
cacheRestoreKeys: string[] = [] cacheRestoreKeys: string[] = []
): Promise<string | undefined> { ): Promise<string | undefined> {
try { try {
return await cache.restoreCache( return await cache.restoreCache(cachePath, cacheKey, cacheRestoreKeys)
cachePath,
cacheKey,
cacheRestoreKeys
)
} catch (error) { } catch (error) {
if (error instanceof cache.ValidationError) { if (error instanceof cache.ValidationError) {
// Validation errors should fail the build action // Validation errors should fail the build action
@ -207,31 +185,23 @@ export abstract class AbstractCache {
const cacheResult = core.getState(this.cacheResultStateKey) const cacheResult = core.getState(this.cacheResultStateKey)
if (!cacheKey) { if (!cacheKey) {
this.debug( this.debug(`${this.cacheDescription} existed prior to cache restore. Not saving.`)
`${this.cacheDescription} existed prior to cache restore. Not saving.`
)
return return
} }
if (cacheResult && cacheKey === cacheResult) { if (cacheResult && cacheKey === cacheResult) {
core.info( core.info(`Cache hit occurred on the cache key ${cacheKey}, not saving cache.`)
`Cache hit occurred on the cache key ${cacheKey}, not saving cache.`
)
return return
} }
try { try {
await this.beforeSave() await this.beforeSave()
} catch (error) { } catch (error) {
core.warning( core.warning(`Save ${this.cacheDescription} failed in 'beforeSave': ${error}`)
`Save ${this.cacheDescription} failed in 'beforeSave': ${error}`
)
return return
} }
core.info( core.info(`Caching ${this.cacheDescription} with cache key: ${cacheKey}`)
`Caching ${this.cacheDescription} with cache key: ${cacheKey}`
)
const cachePath = this.getCachePath() const cachePath = this.getCachePath()
await this.saveCache(cachePath, cacheKey) await this.saveCache(cachePath, cacheKey)
@ -240,10 +210,7 @@ export abstract class AbstractCache {
protected async beforeSave(): Promise<void> {} protected async beforeSave(): Promise<void> {}
protected async saveCache( protected async saveCache(cachePath: string[], cacheKey: string): Promise<void> {
cachePath: string[],
cacheKey: string
): Promise<void> {
try { try {
await cache.saveCache(cachePath, cacheKey) await cache.saveCache(cachePath, cacheKey)
} catch (error) { } catch (error) {

View File

@ -7,9 +7,7 @@ const BUILD_ROOT_DIR = 'BUILD_ROOT_DIR'
export async function restore(buildRootDirectory: string): Promise<void> { export async function restore(buildRootDirectory: string): Promise<void> {
if (isCacheDisabled()) { if (isCacheDisabled()) {
core.info( core.info('Cache is disabled: will not restore state from previous builds.')
'Cache is disabled: will not restore state from previous builds.'
)
return return
} }
@ -24,9 +22,7 @@ export async function restore(buildRootDirectory: string): Promise<void> {
export async function save(): Promise<void> { export async function save(): Promise<void> {
if (isCacheReadOnly()) { if (isCacheReadOnly()) {
core.info( core.info('Cache is read-only: will not save state for use in subsequent builds.')
'Cache is read-only: will not save state for use in subsequent builds.'
)
return return
} }

View File

@ -3,11 +3,7 @@ import fs from 'fs'
import path from 'path' import path from 'path'
import {writeInitScript} from './build-scan-capture' import {writeInitScript} from './build-scan-capture'
export async function execute( export async function execute(executable: string, root: string, args: string[]): Promise<BuildResult> {
executable: string,
root: string,
args: string[]
): Promise<BuildResult> {
let buildScanUrl: string | undefined let buildScanUrl: string | undefined
// TODO: instead of running with no-daemon, run `--stop` in post action. // TODO: instead of running with no-daemon, run `--stop` in post action.

View File

@ -17,10 +17,7 @@ export function locateGradleWrapperScript(buildRootDirectory: string): string {
} }
function validateGradleWrapper(buildRootDirectory: string): void { function validateGradleWrapper(buildRootDirectory: string): void {
const wrapperProperties = path.resolve( const wrapperProperties = path.resolve(buildRootDirectory, 'gradle/wrapper/gradle-wrapper.properties')
buildRootDirectory,
'gradle/wrapper/gradle-wrapper.properties'
)
if (!fs.existsSync(wrapperProperties)) { if (!fs.existsSync(wrapperProperties)) {
throw new Error( throw new Error(
`Cannot locate a Gradle wrapper properties file at '${wrapperProperties}'. Specify 'gradle-version' or 'gradle-executable' for projects without Gradle wrapper configured.` `Cannot locate a Gradle wrapper properties file at '${wrapperProperties}'. Specify 'gradle-version' or 'gradle-executable' for projects without Gradle wrapper configured.`

View File

@ -18,10 +18,7 @@ export async function run(): Promise<void> {
const args: string[] = parseCommandLineArguments() const args: string[] = parseCommandLineArguments()
const result = await execution.execute( const result = await execution.execute(
await resolveGradleExecutable( await resolveGradleExecutable(workspaceDirectory, buildRootDirectory),
workspaceDirectory,
buildRootDirectory
),
buildRootDirectory, buildRootDirectory,
args args
) )
@ -34,9 +31,7 @@ export async function run(): Promise<void> {
if (result.buildScanUrl) { if (result.buildScanUrl) {
core.setFailed(`Gradle build failed: ${result.buildScanUrl}`) core.setFailed(`Gradle build failed: ${result.buildScanUrl}`)
} else { } else {
core.setFailed( core.setFailed(`Gradle build failed: process exited with status ${result.status}`)
`Gradle build failed: process exited with status ${result.status}`
)
} }
} else { } else {
if (result.buildScanUrl) { if (result.buildScanUrl) {
@ -53,10 +48,7 @@ export async function run(): Promise<void> {
run() run()
async function resolveGradleExecutable( async function resolveGradleExecutable(workspaceDirectory: string, buildRootDirectory: string): Promise<string> {
workspaceDirectory: string,
buildRootDirectory: string
): Promise<string> {
const gradleVersion = core.getInput('gradle-version') const gradleVersion = core.getInput('gradle-version')
if (gradleVersion !== '' && gradleVersion !== 'wrapper') { if (gradleVersion !== '' && gradleVersion !== 'wrapper') {
return path.resolve(await provision.gradleVersion(gradleVersion)) return path.resolve(await provision.gradleVersion(gradleVersion))
@ -73,9 +65,7 @@ async function resolveGradleExecutable(
function resolveBuildRootDirectory(baseDirectory: string): string { function resolveBuildRootDirectory(baseDirectory: string): string {
const buildRootDirectory = core.getInput('build-root-directory') const buildRootDirectory = core.getInput('build-root-directory')
const resolvedBuildRootDirectory = const resolvedBuildRootDirectory =
buildRootDirectory === '' buildRootDirectory === '' ? path.resolve(baseDirectory) : path.resolve(baseDirectory, buildRootDirectory)
? path.resolve(baseDirectory)
: path.resolve(baseDirectory, buildRootDirectory)
return resolvedBuildRootDirectory return resolvedBuildRootDirectory
} }

View File

@ -19,9 +19,7 @@ export async function gradleVersion(version: string): Promise<string> {
case 'current': case 'current':
return gradleCurrent() return gradleCurrent()
case 'rc': case 'rc':
core.warning( core.warning(`Specifying gradle-version 'rc' has been deprecated. Use 'release-candidate' instead.`)
`Specifying gradle-version 'rc' has been deprecated. Use 'release-candidate' instead.`
)
return gradleReleaseCandidate() return gradleReleaseCandidate()
case 'release-candidate': case 'release-candidate':
return gradleReleaseCandidate() return gradleReleaseCandidate()
@ -35,16 +33,12 @@ export async function gradleVersion(version: string): Promise<string> {
} }
async function gradleCurrent(): Promise<string> { async function gradleCurrent(): Promise<string> {
const versionInfo = await gradleVersionDeclaration( const versionInfo = await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/current`)
`${gradleVersionsBaseUrl}/current`
)
return provisionGradle(versionInfo) return provisionGradle(versionInfo)
} }
async function gradleReleaseCandidate(): Promise<string> { async function gradleReleaseCandidate(): Promise<string> {
const versionInfo = await gradleVersionDeclaration( const versionInfo = await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-candidate`)
`${gradleVersionsBaseUrl}/release-candidate`
)
if (versionInfo && versionInfo.version && versionInfo.downloadUrl) { if (versionInfo && versionInfo.version && versionInfo.downloadUrl) {
return provisionGradle(versionInfo) return provisionGradle(versionInfo)
} }
@ -53,16 +47,12 @@ async function gradleReleaseCandidate(): Promise<string> {
} }
async function gradleNightly(): Promise<string> { async function gradleNightly(): Promise<string> {
const versionInfo = await gradleVersionDeclaration( const versionInfo = await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/nightly`)
`${gradleVersionsBaseUrl}/nightly`
)
return provisionGradle(versionInfo) return provisionGradle(versionInfo)
} }
async function gradleReleaseNightly(): Promise<string> { async function gradleReleaseNightly(): Promise<string> {
const versionInfo = await gradleVersionDeclaration( const versionInfo = await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`)
`${gradleVersionsBaseUrl}/release-nightly`
)
return provisionGradle(versionInfo) return provisionGradle(versionInfo)
} }
@ -74,34 +64,24 @@ async function gradle(version: string): Promise<string> {
return provisionGradle(versionInfo) return provisionGradle(versionInfo)
} }
async function gradleVersionDeclaration( async function gradleVersionDeclaration(url: string): Promise<GradleVersionInfo> {
url: string
): Promise<GradleVersionInfo> {
return await httpGetGradleVersion(url) return await httpGetGradleVersion(url)
} }
async function findGradleVersionDeclaration( async function findGradleVersionDeclaration(version: string): Promise<GradleVersionInfo | undefined> {
version: string const gradleVersions = await httpGetGradleVersions(`${gradleVersionsBaseUrl}/all`)
): Promise<GradleVersionInfo | undefined> {
const gradleVersions = await httpGetGradleVersions(
`${gradleVersionsBaseUrl}/all`
)
return gradleVersions.find((entry: GradleVersionInfo) => { return gradleVersions.find((entry: GradleVersionInfo) => {
return entry.version === version return entry.version === version
}) })
} }
async function provisionGradle( async function provisionGradle(versionInfo: GradleVersionInfo): Promise<string> {
versionInfo: GradleVersionInfo
): Promise<string> {
return core.group(`Provision Gradle ${versionInfo.version}`, async () => { return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
return locateGradleAndDownloadIfRequired(versionInfo) return locateGradleAndDownloadIfRequired(versionInfo)
}) })
} }
async function locateGradleAndDownloadIfRequired( async function locateGradleAndDownloadIfRequired(versionInfo: GradleVersionInfo): Promise<string> {
versionInfo: GradleVersionInfo
): Promise<string> {
const installsDir = path.join(os.homedir(), 'gradle-installations/installs') const installsDir = path.join(os.homedir(), 'gradle-installations/installs')
const installDir = path.join(installsDir, `gradle-${versionInfo.version}`) const installDir = path.join(installsDir, `gradle-${versionInfo.version}`)
if (fs.existsSync(installDir)) { if (fs.existsSync(installDir)) {
@ -120,13 +100,8 @@ async function locateGradleAndDownloadIfRequired(
return executable return executable
} }
async function downloadAndCacheGradleDistribution( async function downloadAndCacheGradleDistribution(versionInfo: GradleVersionInfo): Promise<string> {
versionInfo: GradleVersionInfo const downloadPath = path.join(os.homedir(), `gradle-installations/downloads/gradle-${versionInfo.version}-bin.zip`)
): Promise<string> {
const downloadPath = path.join(
os.homedir(),
`gradle-installations/downloads/gradle-${versionInfo.version}-bin.zip`
)
if (isCacheDisabled()) { if (isCacheDisabled()) {
await downloadGradleDistribution(versionInfo, downloadPath) await downloadGradleDistribution(versionInfo, downloadPath)
@ -136,14 +111,10 @@ async function downloadAndCacheGradleDistribution(
const cacheKey = `gradle-${versionInfo.version}` const cacheKey = `gradle-${versionInfo.version}`
const restoreKey = await cache.restoreCache([downloadPath], cacheKey) const restoreKey = await cache.restoreCache([downloadPath], cacheKey)
if (restoreKey) { if (restoreKey) {
core.info( core.info(`Restored Gradle distribution ${cacheKey} from cache to ${downloadPath}`)
`Restored Gradle distribution ${cacheKey} from cache to ${downloadPath}`
)
return downloadPath return downloadPath
} }
core.info( core.info(`Gradle distribution ${versionInfo.version} not found in cache. Will download.`)
`Gradle distribution ${versionInfo.version} not found in cache. Will download.`
)
await downloadGradleDistribution(versionInfo, downloadPath) await downloadGradleDistribution(versionInfo, downloadPath)
if (!isCacheReadOnly()) { if (!isCacheReadOnly()) {
@ -151,10 +122,7 @@ async function downloadAndCacheGradleDistribution(
await cache.saveCache([downloadPath], cacheKey) await cache.saveCache([downloadPath], cacheKey)
} catch (error) { } catch (error) {
// Fail on validation errors or non-errors (the latter to keep Typescript happy) // Fail on validation errors or non-errors (the latter to keep Typescript happy)
if ( if (error instanceof cache.ValidationError || !(error instanceof Error)) {
error instanceof cache.ValidationError ||
!(error instanceof Error)
) {
throw error throw error
} }
core.warning(error.message) core.warning(error.message)
@ -163,16 +131,9 @@ async function downloadAndCacheGradleDistribution(
return downloadPath return downloadPath
} }
async function downloadGradleDistribution( async function downloadGradleDistribution(versionInfo: GradleVersionInfo, downloadPath: string): Promise<void> {
versionInfo: GradleVersionInfo,
downloadPath: string
): Promise<void> {
await toolCache.downloadTool(versionInfo.downloadUrl, downloadPath) await toolCache.downloadTool(versionInfo.downloadUrl, downloadPath)
core.info( core.info(`Downloaded ${versionInfo.downloadUrl} to ${downloadPath} (size ${fs.statSync(downloadPath).size})`)
`Downloaded ${versionInfo.downloadUrl} to ${downloadPath} (size ${
fs.statSync(downloadPath).size
})`
)
} }
function executableFrom(installDir: string): string { function executableFrom(installDir: string): string {
@ -183,9 +144,7 @@ async function httpGetGradleVersion(url: string): Promise<GradleVersionInfo> {
return JSON.parse(await httpGetString(url)) return JSON.parse(await httpGetString(url))
} }
async function httpGetGradleVersions( async function httpGetGradleVersions(url: string): Promise<GradleVersionInfo[]> {
url: string
): Promise<GradleVersionInfo[]> {
return JSON.parse(await httpGetString(url)) return JSON.parse(await httpGetString(url))
} }