Skip to content

Commit

Permalink
fix: Issue with extraFiles not being valid
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Feb 24, 2017
1 parent 6292855 commit f137193
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"pretest": "node ./test/vendor/yarn.js compile && node ./test/vendor/yarn.js lint && node ./test/vendor/yarn.js lint-deps",
"lint-deps": "node ./test/out/helpers/checkDeps.js",
"///": "Please see https://github.com/electron-userland/electron-builder/blob/master/CONTRIBUTING.md#run-test-using-cli how to run particular test instead full (and very slow) run",
"test": "node ./test/out/helpers/runTests.js skipArtifactPublisher ALL_TESTS=false",
"test": "node ./test/out/helpers/runTests.js skipArtifactPublisher ALL_TESTS=isCi",
"test-all": "node ./test/vendor/yarn.js pretest && node ./test/out/helpers/runTests.js",
"test-linux": "docker run --rm -ti -v ${PWD}: /project -v ${PWD##*/}-node-modules:/project/node_modules -v ~/.electron:/root/.electron electronuserland/electron-builder:wine /bin/bash -c \"node ./test/vendor/yarn.js && node ./test/vendor/yarn.js test\"",
"//": "Update wiki if docs changed. Update only if functionalily are generally available (latest release, not next)",
Expand Down
8 changes: 4 additions & 4 deletions packages/electron-builder/src/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ export interface Config extends PlatformSpecificBuildOptions, TargetSpecificOpti
Glob rules the same as for [files](#multiple-glob-patterns).
*/
readonly extraResources?: Array<FilePattern> | FilePattern | Array<string> | string | null
readonly extraResources?: Array<FilePattern | string> | FilePattern | string | null

/**
The same as [extraResources](#Config-extraResources) but copy into the app's content directory (`Contents` for MacOS, root directory for Linux/Windows).
*/
readonly extraFiles?: Array<FilePattern> | FilePattern | Array<string> | string | null
readonly extraFiles?: Array<FilePattern | string> | FilePattern | string | null

/**
Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/). Defaults to `true`.
Expand Down Expand Up @@ -325,8 +325,8 @@ export interface MetadataDirectories {

export interface PlatformSpecificBuildOptions extends TargetSpecificOptions {
readonly files?: Array<string> | string | null
readonly extraFiles?: Array<FilePattern> | FilePattern | Array<string> | string | null
readonly extraResources?: Array<FilePattern> | FilePattern | Array<string> | string | null
readonly extraFiles?: Array<FilePattern | string> | FilePattern | string | null
readonly extraResources?: Array<FilePattern | string> | FilePattern | string | null

readonly asarUnpack?: Array<string> | string | null

Expand Down
30 changes: 30 additions & 0 deletions test/src/BuildTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,34 @@ describe.ifAll("sign", () => {
appId: 123,
},
}))

// https://github.com/electron-userland/electron-builder/issues/1302
test.ifDevOrLinuxCi("scheme validation extraFiles", app({
targets: linuxDirTarget,
config: <any>{
"extraFiles": [
"lib/*.jar",
"lib/Proguard/**/*",
{
"from": "lib/",
"to": ".",
"filter": [
"*.dll"
]
},
{
"from": "lib/",
"to": ".",
"filter": [
"*.exe"
]
},
"BLClient/BLClient.json",
{
"from": "include/",
"to": "."
}
],
},
}))
})
6 changes: 5 additions & 1 deletion test/src/helpers/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ async function runTests() {
else if (scriptArg.includes("=")) {
const equalIndex = scriptArg.indexOf("=")
const envName = scriptArg.substring(0, equalIndex)
const envValue = scriptArg.substring(equalIndex + 1)
let envValue = scriptArg.substring(equalIndex + 1)
if (envValue === "isCi") {
envValue = isCi ? "true" : "false"
}

process.env[envName] = envValue
console.log(`Custom env ${envName}=${envValue}`)

Expand Down

0 comments on commit f137193

Please sign in to comment.