Replace static config methods with config types

This will allow different entry points to have different inputs.
This commit is contained in:
daz
2024-04-06 20:37:46 -06:00
parent ed4d086d37
commit cfd20ecc0a
16 changed files with 337 additions and 323 deletions

View File

@@ -1,6 +1,7 @@
import {GradleStateCache} from "../../src/cache-base"
import * as path from 'path'
import * as fs from 'fs'
import {GradleStateCache} from "../../src/cache-base"
import {CacheConfig} from "../../src/input-params"
const testTmp = 'test/jest/tmp'
fs.rmSync(testTmp, {recursive: true, force: true})
@@ -11,7 +12,7 @@ describe("--info and --stacktrace", () => {
const emptyGradleHome = `${testTmp}/empty-gradle-home`
fs.mkdirSync(emptyGradleHome, {recursive: true})
const stateCache = new GradleStateCache("ignored", emptyGradleHome)
const stateCache = new GradleStateCache("ignored", emptyGradleHome, new CacheConfig())
stateCache.configureInfoLogLevel()
expect(fs.readFileSync(path.resolve(emptyGradleHome, "gradle.properties"), 'utf-8'))
@@ -24,7 +25,7 @@ describe("--info and --stacktrace", () => {
fs.mkdirSync(existingGradleHome, {recursive: true})
fs.writeFileSync(path.resolve(existingGradleHome, "gradle.properties"), "org.gradle.logging.level=debug\n")
const stateCache = new GradleStateCache("ignored", existingGradleHome)
const stateCache = new GradleStateCache("ignored", existingGradleHome, new CacheConfig())
stateCache.configureInfoLogLevel()
expect(fs.readFileSync(path.resolve(existingGradleHome, "gradle.properties"), 'utf-8'))