-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,80 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>Polyglot</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>XPC!</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>3.1</string> | ||
<key>CFBundleVersion</key> | ||
<string>3.1.0</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.Safari.extension</string> | ||
<key>NSExtensionPrincipalClass</key> | ||
<string>$(PRODUCT_MODULE_NAME).SafariExtensionHandler</string> | ||
<key>SFSafariContentScript</key> | ||
<array> | ||
<dict> | ||
<key>Script</key> | ||
<string>content.bundle.js</string> | ||
</dict> | ||
</array> | ||
<key>SFSafariContextMenu</key> | ||
<array> | ||
<dict> | ||
<key>Command</key> | ||
<string>tarnslateSelectedText</string> | ||
<key>Text</key> | ||
<string>Translate</string> | ||
</dict> | ||
</array> | ||
<key>SFSafariExtensionBundleIdentifiersToUninstall</key> | ||
<array> | ||
<string>co.randompaper.polyglot.extension</string> | ||
</array> | ||
<key>SFSafariStyleSheet</key> | ||
<array> | ||
<dict> | ||
<key>Style Sheet</key> | ||
<string>content.css</string> | ||
</dict> | ||
</array> | ||
<key>SFSafariToolbarItem</key> | ||
<dict> | ||
<key>Action</key> | ||
<string>Command</string> | ||
<key>Identifier</key> | ||
<string>translateButton</string> | ||
<key>Image</key> | ||
<string>toolbar-icon.png</string> | ||
<key>Label</key> | ||
<string>Translate</string> | ||
</dict> | ||
<key>SFSafariWebsiteAccess</key> | ||
<dict> | ||
<key>Level</key> | ||
<string>All</string> | ||
</dict> | ||
</dict> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2019 Yasuaki Uechi. Apache 2.0 license.</string> | ||
<key>NSHumanReadableDescription</key> | ||
<string>Translate selected text into your native language.</string> | ||
</dict> | ||
</plist> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>Polyglot</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>XPC!</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>3.2.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>3.2.0</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.Safari.extension</string> | ||
<key>NSExtensionPrincipalClass</key> | ||
<string>$(PRODUCT_MODULE_NAME).SafariExtensionHandler</string> | ||
<key>SFSafariContentScript</key> | ||
<array> | ||
<dict> | ||
<key>Script</key> | ||
<string>content.bundle.js</string> | ||
</dict> | ||
</array> | ||
<key>SFSafariContextMenu</key> | ||
<array> | ||
<dict> | ||
<key>Command</key> | ||
<string>tarnslateSelectedText</string> | ||
<key>Text</key> | ||
<string>Translate</string> | ||
</dict> | ||
</array> | ||
<key>SFSafariExtensionBundleIdentifiersToUninstall</key> | ||
<array> | ||
<string>co.randompaper.polyglot.extension</string> | ||
</array> | ||
<key>SFSafariStyleSheet</key> | ||
<array> | ||
<dict> | ||
<key>Style Sheet</key> | ||
<string>content.css</string> | ||
</dict> | ||
</array> | ||
<key>SFSafariToolbarItem</key> | ||
<dict> | ||
<key>Action</key> | ||
<string>Command</string> | ||
<key>Identifier</key> | ||
<string>translateButton</string> | ||
<key>Image</key> | ||
<string>toolbar-icon.png</string> | ||
<key>Label</key> | ||
<string>Translate</string> | ||
</dict> | ||
<key>SFSafariWebsiteAccess</key> | ||
<dict> | ||
<key>Level</key> | ||
<string>All</string> | ||
</dict> | ||
</dict> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2019 Yasuaki Uechi. Apache 2.0 license.</string> | ||
<key>NSHumanReadableDescription</key> | ||
<string>Translate selected text into your native language.</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,38 @@ | ||
#!/usr/bin/env node | ||
|
||
const path = require('path') | ||
const fs = require('fs') | ||
const assert = require('assert') | ||
const { execSync } = require('child_process') | ||
const plist = require('plist') | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const assert = require("assert"); | ||
const plist = require("plist"); | ||
|
||
const shortVersion = process.env.VERSION | ||
assert(shortVersion, 'specify VERSION envvar') | ||
const bundleVersion = process.env.VERSION; | ||
assert(bundleVersion, "specify VERSION envvar"); | ||
|
||
const buildId = process.env.BUILD | ||
assert(buildId, 'specify BUILD envvar') | ||
|
||
const bundleVersion = shortVersion + '.' + buildId | ||
|
||
console.log(`CFBundleShortVersionString: ${shortVersion}`) | ||
console.log(`CFBundleVersion: ${bundleVersion}`) | ||
console.log(`CFBundleShortVersionString: ${bundleVersion}`); | ||
console.log(`CFBundleVersion: ${bundleVersion}`); | ||
|
||
// rewrite `Polyglot/Info.plist` | ||
const appInfoPath = path.resolve(__dirname, '../Polyglot/Info.plist') | ||
console.log(`rewriting '${appInfoPath}'`) | ||
const appInfo = plist.parse(fs.readFileSync(appInfoPath, 'utf8')) | ||
appInfo['CFBundleShortVersionString'] = shortVersion | ||
appInfo['CFBundleVersion'] = bundleVersion | ||
fs.writeFileSync(appInfoPath, plist.build(appInfo)) | ||
const appInfoPath = path.resolve(__dirname, "../Polyglot/Info.plist"); | ||
console.log(`rewriting '${appInfoPath}'`); | ||
const appInfo = plist.parse(fs.readFileSync(appInfoPath, "utf8")); | ||
appInfo["CFBundleShortVersionString"] = bundleVersion; | ||
appInfo["CFBundleVersion"] = bundleVersion; | ||
fs.writeFileSync(appInfoPath, plist.build(appInfo)); | ||
|
||
// rewrite `PolyglotSafariExtension/Info.plist` | ||
const extInfoPath = path.resolve( | ||
__dirname, | ||
'../PolyglotSafariExtension/Info.plist' | ||
) | ||
console.log(`rewriting '${extInfoPath}'`) | ||
const extInfo = plist.parse(fs.readFileSync(extInfoPath, 'utf8')) | ||
extInfo['CFBundleShortVersionString'] = shortVersion | ||
extInfo['CFBundleVersion'] = bundleVersion | ||
fs.writeFileSync(extInfoPath, plist.build(extInfo)) | ||
"../PolyglotSafariExtension/Info.plist" | ||
); | ||
console.log(`rewriting '${extInfoPath}'`); | ||
const extInfo = plist.parse(fs.readFileSync(extInfoPath, "utf8")); | ||
extInfo["CFBundleShortVersionString"] = bundleVersion; | ||
extInfo["CFBundleVersion"] = bundleVersion; | ||
fs.writeFileSync(extInfoPath, plist.build(extInfo)); | ||
|
||
// rewrite `package.json` | ||
const packagePath = path.resolve(__dirname, '../package.json') | ||
console.log(`rewriting '${packagePath}'`) | ||
const package = require(packagePath) | ||
package.version = bundleVersion | ||
fs.writeFileSync(packagePath, JSON.stringify(package, null, 2)) | ||
const packagePath = path.resolve(__dirname, "../package.json"); | ||
console.log(`rewriting '${packagePath}'`); | ||
const package = require(packagePath); | ||
package.version = bundleVersion; | ||
fs.writeFileSync(packagePath, JSON.stringify(package, null, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters