当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Platform.LINUX.createTarget方法代码示例

本文整理汇总了TypeScript中electron-builder.Platform.LINUX.createTarget方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Platform.LINUX.createTarget方法的具体用法?TypeScript Platform.LINUX.createTarget怎么用?TypeScript Platform.LINUX.createTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在electron-builder.Platform.LINUX的用法示例。


在下文中一共展示了Platform.LINUX.createTarget方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: async

test.ifAll.ifDevOrLinuxCi("default stagePackages", async () => {
  for (const p of [["default"], ["default", "custom"], ["custom", "default"], ["foo1", "default", "foo2"]]) {
    await assertPack("test-app-one", {
      targets: Platform.LINUX.createTarget("snap"),
      config: {
        extraMetadata: {
          name: "sep",
        },
        productName: "Sep",
        snap: {
          stagePackages: p,
          plugs: p,
          confinement: "classic",
          // otherwise "parts" will be removed
          useTemplateApp: false,
        }
      },
      effectiveOptionComputed: async ({snap}) => {
        delete snap.parts.app.source
        expect(snap).toMatchSnapshot()
        return true
      },
    })
  }
})
开发者ID:electron-userland,项目名称:electron-builder,代码行数:25,代码来源:snapTest.ts

示例2: createExtraMetadataTest

function createExtraMetadataTest(asar: boolean) {
  return app({
    targets: Platform.LINUX.createTarget(DIR_TARGET),
    extraMetadata: {
      foo: {
        bar: 12,
      },
      build: {
        asar: asar,
        linux: {
          executableName: "new-name",
        },
      }
    },
  }, {
    projectDirCreated: projectDir => modifyPackageJson(projectDir, data => {
      data.scripts = {}
      data.devDependencies = {"foo": "boo"}
      data.foo = {
        bar: 42,
        existingProp: 22,
      }
    }),
    packed: async context => {
      await assertThat(path.join(context.getContent(Platform.LINUX), "new-name")).isFile()
      if (asar) {
        expect(await readAsarJson(path.join(context.getResources(Platform.LINUX), "app.asar"), "package.json")).toMatchSnapshot()
      }
      else {
        expect(await readJson(path.join(context.getResources(Platform.LINUX), "app", "package.json"))).toMatchSnapshot()
      }
    }
  })
}
开发者ID:djpereira,项目名称:electron-builder,代码行数:34,代码来源:extraMetadataTest.ts

示例3: testLinux

async function testLinux(arch: Arch) {
  process.env.TEST_UPDATER_PLATFORM = "linux"
  process.env.TEST_UPDATER_ARCH = Arch[arch]

  const outDirs: Array<string> = []
  await doBuild(outDirs, Platform.LINUX.createTarget(["appimage"], arch))

  process.env.APPIMAGE = path.join(outDirs[0], `TestApp-1.0.0-${arch === Arch.x64 ? "x86_64" : "i386"}.AppImage`)
  await testBlockMap(outDirs[0], path.join(outDirs[1]), AppImageUpdater)
}
开发者ID:ledinhphuong,项目名称:electron-builder,代码行数:10,代码来源:differentialUpdateTest.ts

示例4: assertPack

test.ifDevOrLinuxCi("unpackDir", () => {
  return assertPack("test-app", {
    targets: Platform.LINUX.createTarget(DIR_TARGET),
    config: {
      asarUnpack: ["assets", "b2", "do-not-unpack-dir/file.json"],
    }
  }, {
    projectDirCreated: projectDir => createFiles(path.join(projectDir, "app")),
    packed: assertDirs,
  })
})
开发者ID:yuya-oc,项目名称:electron-builder,代码行数:11,代码来源:globTest.ts

示例5: rename

  packed: async context => {
    // test https://github.com/electron-userland/electron-builder/issues/1102
    const projectDir = context.getResources(Platform.LINUX)

    await rename(path.join(projectDir, "electron.asar"), path.join(projectDir, "someAsarFile.asar"))

    await build({
      targets: Platform.LINUX.createTarget(),
      projectDir: projectDir,
    })

    await assertThat(path.join(projectDir, "dist")).isDirectory()
    await assertThat(path.join(projectDir, "dist", "linux-unpacked", "resources", "someAsarFile.asar")).isFile()
  },
开发者ID:mbrainiac,项目名称:electron-builder,代码行数:14,代码来源:linuxPackagerTest.ts

示例6: testLinux

async function testLinux(arch: Arch) {
  process.env.TEST_UPDATER_ARCH = Arch[arch]

  const outDirs: Array<string> = []
  const tmpDir = new TmpDir("differential-updater-test")
  try {
    await doBuild(outDirs, Platform.LINUX.createTarget(["appimage"], arch), tmpDir)

    process.env.APPIMAGE = path.join(outDirs[0], `TestApp-1.0.0-${arch === Arch.x64 ? "x86_64" : "i386"}.AppImage`)
    await testBlockMap(outDirs[0], path.join(outDirs[1]), AppImageUpdater, `__appImage-${Arch[arch]}`, Platform.LINUX)
  }
  finally {
    await tmpDir.cleanup()
  }
}
开发者ID:electron-userland,项目名称:electron-builder,代码行数:15,代码来源:differentialUpdateTest.ts

示例7: rename

  packed: async context => {
    const projectDir = context.getResources(Platform.LINUX)

    await rename(path.join(projectDir, "electron.asar"), path.join(projectDir, "someAsarFile.asar"))

    await build({
      targets: Platform.LINUX.createTarget(),
      projectDir,
      publish: "never",
      config: {
        electronVersion: ELECTRON_VERSION,
        compression: "store",
        npmRebuild: false,
      }
    })

    await assertThat(path.join(projectDir, "dist")).isDirectory()
    await assertThat(path.join(projectDir, "dist", "linux-unpacked", "resources", "someAsarFile.asar")).isFile()
  },
开发者ID:yuya-oc,项目名称:electron-builder,代码行数:19,代码来源:linuxPackagerTest.ts

示例8: assertPack

test.ifDevOrLinuxCi("asarUnpack and files ignore", () => {
  return assertPack("test-app", {
    targets: Platform.LINUX.createTarget(DIR_TARGET),
    config: {
      asarUnpack: [
        "!**/ffprobe-static/bin/darwin/x64/ffprobe"
      ],
    }
  }, {
    projectDirCreated: projectDir => outputFile(path.join(projectDir, "node_modules/ffprobe-static/bin/darwin/x64/ffprobe"), "data"),
    packed: async context => {
      const resourceDir = context.getResources(Platform.LINUX)
      await Promise.all([
        assertThat(path.join(resourceDir, "app.asar.unpacked", "node_modules/ffprobe-static/bin/darwin/x64/ffprobe")).doesNotExist(),
      ])

      await verifyAsarFileTree(context.getResources(Platform.LINUX))
    },
  })
})
开发者ID:electron-userland,项目名称:electron-builder,代码行数:20,代码来源:globTest.ts

示例9: createExtraMetadataTest

function createExtraMetadataTest(asar: boolean) {
  return app({
    targets: Platform.LINUX.createTarget(DIR_TARGET),
    config: coerceTypes({
      asar,
      linux: {
        executableName: "new-name",
      },
      extraMetadata: {
        version: "1.0.0-beta.19",
        foo: {
          bar: 12,
          updated: "true",
          disabled: "false",
        },
        rootKey: "false",
        rootKeyT: "true",
        rootKeyN: "null",
      },
    }),
  }, {
    projectDirCreated: projectDir => modifyPackageJson(projectDir, data => {
      data.scripts = {}
      data.devDependencies = {foo: "boo"}
      data.foo = {
        bar: 42,
        existingProp: 22,
      }
    }),
    packed: async context => {
      await assertThat(path.join(context.getContent(Platform.LINUX), "new-name")).isFile()
      if (asar) {
        expect(await readAsarJson(path.join(context.getResources(Platform.LINUX), "app.asar"), "package.json")).toMatchSnapshot()
      }
      else {
        expect(await readJson(path.join(context.getResources(Platform.LINUX), "app", "package.json"))).toMatchSnapshot()
      }
    }
  })
}
开发者ID:jwheare,项目名称:electron-builder,代码行数:40,代码来源:extraMetadataTest.ts


注:本文中的electron-builder.Platform.LINUX.createTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。