fix e2e for sbt.

This commit is contained in:
Florian Meriaux 2022-04-12 11:53:42 +02:00
parent 7df480742f
commit b9d25ecda2
No known key found for this signature in database
GPG key ID: A3F999CB41DB6BE2
66 changed files with 110 additions and 12 deletions

View file

@ -132,12 +132,33 @@ jobs:
java-version: '11' java-version: '11'
cache: sbt cache: sbt
- name: Create files to cache - name: Create files to cache
run: sbt update
- name: Check files to cache on macos-latest
if: matrix.os == 'macos-latest'
run: | run: |
sbt update if [ ! -d ~/Library/Caches/Coursier ]; then
if [ ! -d ~/.ivy2/cache ]; then echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
echo "::error::The ~/.ivy2/cache directory does not exist unexpectedly"
exit 1 exit 1
fi fi
- name: Check files to cache on windows-latest
if: matrix.os == 'windows-latest'
run: |
if [ ! -d ~/AppData/Local/Coursier/Cache ]; then
echo "::error::The ~/AppData/Local/Coursier/Cache directory does not exist unexpectedly"
exit 1
fi
- name: Check files to cache on ubuntu-latest
if: matrix.os == 'ubuntu-latest'
run: |
if [ ! -d ~/.cache/coursier ]; then
echo "::error::The ~/.cache/coursier directory does not exist unexpectedly"
exit 1
fi
sbt-restore: sbt-restore:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
defaults: defaults:

View file

@ -123,7 +123,7 @@ describe('dependency cache', () => {
await expect(restore('sbt')).rejects.toThrowError( await expect(restore('sbt')).rejects.toThrowError(
`No file in ${projectRoot( `No file in ${projectRoot(
workspace workspace
)} matched to [**/*.sbt,**/project/build.properties,**/project/**.scala], make sure you have checked out the target repository` )} matched to [*.sbt,project/build.properties,project/**.{scala,sbt}], make sure you have checked out the target repository`
); );
}); });
it('downloads cache', async () => { it('downloads cache', async () => {

View file

@ -1,3 +1,3 @@
ThisBuild / scalaVersion := "3.1.1" ThisBuild / scalaVersion := "2.12.15"
libraryDependencies += "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % Test libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"

View file

@ -0,0 +1 @@
sbt.version=1.6.2

View file

@ -0,0 +1 @@
sbt.internal.DslEntry

View file

@ -0,0 +1 @@
sbt.internal.DslEntry

View file

@ -0,0 +1 @@
[[{},{}],{}]

View file

@ -0,0 +1 @@
969967227

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"{\"organization\":\"org.scala-lang\",\"name\":\"scala-library\",\"revision\":\"2.12.15\",\"configurations\":\"provided\",\"isChanging\":false,\"isTransitive\":true,\"isForce\":false,\"explicitArtifacts\":[],\"inclusions\":[],\"exclusions\":[],\"extraAttributes\":{},\"crossVersion\":{\"type\":\"Disabled\"}}":{"value":{"$fields":["path","startLine"],"path":"(sbt.Classpaths.jvmBaseSettings) Defaults.scala","startLine":3254},"type":"LinePosition"}}

View file

@ -0,0 +1,3 @@
[debug] not up to date. inChanged = true, force = false
[debug] Updating ProjectRef(uri("file:/Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/project/"), "sbt-build")...
[debug] Done updating ProjectRef(uri("file:/Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/project/"), "sbt-build")

View file

@ -0,0 +1 @@
["sbt.Task[scala.collection.Seq[java.nio.file.Path]]",["/Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/project/target/scala-2.12/sbt-1.0/zinc/inc_compile_2.12.zip"]]

View file

@ -0,0 +1,6 @@
[debug] [zinc] IncrementalCompile -----------
[debug] IncrementalCompile.incrementalCompile
[debug] previous = Stamps for: 0 products, 0 sources, 0 libraries
[debug] current source = Set()
[debug] > initialChanges = InitialChanges(Changes(added = Set(), removed = Set(), changed = Set(), unmodified = ...),Set(),Set(),API Changes: Set())
[debug] Full compilation, no sources in previous analysis.

View file

@ -0,0 +1,2 @@
[debug] Copy resource mappings: 
[debug]  

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
/Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/project/target/scala-2.12/sbt-1.0/classes

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
[debug] Created transactional ClassFileManager with tempDir = /Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/project/target/scala-2.12/sbt-1.0/classes.bak
[debug] Removing the temporary directory used for backing up class files: /Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/project/target/scala-2.12/sbt-1.0/classes.bak

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
/Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/project/target/scala-2.12/sbt-1.0/classes

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
/Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/project/target/scala-2.12/sbt-1.0/classes

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
-510718803

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"{\"organization\":\"org.scala-lang\",\"name\":\"scala-library\",\"revision\":\"2.12.15\",\"isChanging\":false,\"isTransitive\":true,\"isForce\":false,\"explicitArtifacts\":[],\"inclusions\":[],\"exclusions\":[],\"extraAttributes\":{},\"crossVersion\":{\"type\":\"Disabled\"}}":{"value":{"$fields":["path","range"],"path":"/Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/build.sbt","range":{"$fields":["start","end"],"start":3,"end":4}},"type":"RangePosition"},"{\"organization\":\"org.scala-lang.modules\",\"name\":\"scala-parser-combinators\",\"revision\":\"1.1.2\",\"isChanging\":false,\"isTransitive\":true,\"isForce\":false,\"explicitArtifacts\":[],\"inclusions\":[],\"exclusions\":[],\"extraAttributes\":{},\"crossVersion\":{\"type\":\"Binary\",\"prefix\":\"\",\"suffix\":\"\"}}":{"value":{"$fields":["path","range"],"path":"/Users/fmeriaux/Documents/Projects/OS/setup-java/__tests__/cache/sbt/build.sbt","range":{"$fields":["start","end"],"start":3,"end":4}},"type":"RangePosition"}}

View file

@ -0,0 +1,3 @@
[debug] not up to date. inChanged = true, force = true
[debug] Updating ...
[debug] Done updating 

15
dist/cleanup/index.js vendored
View file

@ -61889,10 +61889,21 @@ const supportedPackageManager = [
}, },
{ {
id: 'sbt', id: 'sbt',
path: [path_1.join(os_1.default.homedir(), '.ivy2', 'cache'), path_1.join(os_1.default.homedir(), '.sbt')], path: [
pattern: ['**/*.sbt', '**/project/build.properties', '**/project/**.scala'] path_1.join(os_1.default.homedir(), '.ivy2', 'cache'),
path_1.join(os_1.default.homedir(), '.sbt'),
getCoursierCachePath()
],
pattern: ['*.sbt', 'project/build.properties', 'project/**.{scala,sbt}']
} }
]; ];
function getCoursierCachePath() {
if (os_1.default.type() === 'Linux')
return path_1.join(os_1.default.homedir(), 'AppData', 'Local', 'Coursier', 'Cache');
if (os_1.default.type() === 'Darwin')
return path_1.join(os_1.default.homedir(), 'Library', 'Caches', 'Coursier');
return path_1.join(os_1.default.homedir(), '.cache', 'coursier');
}
function findPackageManager(id) { function findPackageManager(id) {
const packageManager = supportedPackageManager.find(packageManager => packageManager.id === id); const packageManager = supportedPackageManager.find(packageManager => packageManager.id === id);
if (packageManager === undefined) { if (packageManager === undefined) {

15
dist/setup/index.js vendored
View file

@ -18626,10 +18626,21 @@ const supportedPackageManager = [
}, },
{ {
id: 'sbt', id: 'sbt',
path: [path_1.join(os_1.default.homedir(), '.ivy2', 'cache'), path_1.join(os_1.default.homedir(), '.sbt')], path: [
pattern: ['**/*.sbt', '**/project/build.properties', '**/project/**.scala'] path_1.join(os_1.default.homedir(), '.ivy2', 'cache'),
path_1.join(os_1.default.homedir(), '.sbt'),
getCoursierCachePath()
],
pattern: ['*.sbt', 'project/build.properties', 'project/**.{scala,sbt}']
} }
]; ];
function getCoursierCachePath() {
if (os_1.default.type() === 'Linux')
return path_1.join(os_1.default.homedir(), 'AppData', 'Local', 'Coursier', 'Cache');
if (os_1.default.type() === 'Darwin')
return path_1.join(os_1.default.homedir(), 'Library', 'Caches', 'Coursier');
return path_1.join(os_1.default.homedir(), '.cache', 'coursier');
}
function findPackageManager(id) { function findPackageManager(id) {
const packageManager = supportedPackageManager.find(packageManager => packageManager.id === id); const packageManager = supportedPackageManager.find(packageManager => packageManager.id === id);
if (packageManager === undefined) { if (packageManager === undefined) {

View file

@ -35,11 +35,21 @@ const supportedPackageManager: PackageManager[] = [
}, },
{ {
id: 'sbt', id: 'sbt',
path: [join(os.homedir(), '.ivy2', 'cache'), join(os.homedir(), '.sbt')], path: [
pattern: ['**/*.sbt', '**/project/build.properties', '**/project/**.scala'] join(os.homedir(), '.ivy2', 'cache'),
join(os.homedir(), '.sbt'),
getCoursierCachePath()
],
pattern: ['*.sbt', 'project/build.properties', 'project/**.{scala,sbt}']
} }
]; ];
function getCoursierCachePath(): string {
if (os.type() === 'Linux') return join(os.homedir(), 'AppData', 'Local', 'Coursier', 'Cache');
if (os.type() === 'Darwin') return join(os.homedir(), 'Library', 'Caches', 'Coursier');
return join(os.homedir(), '.cache', 'coursier');
}
function findPackageManager(id: string): PackageManager { function findPackageManager(id: string): PackageManager {
const packageManager = supportedPackageManager.find(packageManager => packageManager.id === id); const packageManager = supportedPackageManager.find(packageManager => packageManager.id === id);
if (packageManager === undefined) { if (packageManager === undefined) {