Skip to content

Commit

Permalink
Adobe CEP packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrop committed Aug 23, 2018
1 parent 61b7fb5 commit 90be899
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 4 deletions.
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,20 @@ notes.md
.env

# mac file system
.DS_Store
.DS_Store

# used for packaging Adobe CEP extension, before packaging and signing, exclude to avoid conflice
adobe-panel-build/

# self signed certificate needed for Adobe CEP Panel
ccextensionsmac/certificate.p12

# including ZXPSignCmd comand
# ccextensionsmac/ZXPSignCmd

# Packaged app for Adobe CEP Panel Exchange site submission or distribution.
dist/com.autoedit2.it.zxp


# dotenv ENV var
.env
1 change: 1 addition & 0 deletions adobe-panel-src/.debug
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Extension Id="com.autoedit2.it">
<HostList>
<Host Name="PPRO" Port="8099"/>
<Host Name="AEFT" Port="8098"/>
</HostList>
</Extension>
</ExtensionList>
6 changes: 5 additions & 1 deletion adobe-panel-src/jsx/Premiere.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ $._PPP = {
var papercut = clipEvents[i];
// https://forums.adobe.com/thread/2455401
var arrayOfProjectItemsReferencingSomePath = app.project.rootItem.findItemsMatchingMediaPath( papercut.clipName, 1);
var clipInProjectPanel = arrayOfProjectItemsReferencingSomePath[0]
var clipInProjectPanel = arrayOfProjectItemsReferencingSomePath[0];
// TODO: need to had catch for what happens if file is not in project panel.
// eg either return error, eg alert cannot continue add clip to project panel
// or look for projec ton file system using path?

// set in and out point for clip
clipInProjectPanel.setInPoint(parseFloat(papercut.startTime));
clipInProjectPanel.setOutPoint(parseFloat(papercut.endTime));
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ccextensionsmac/ZXPSignCmd
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/app/views/transcription_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ module.exports = Backbone.View.extend({
if(searchTextArray.length > 0){
for(var i = 0; i < searchTextArray.length; i++){
$('.words[data-text='+searchTextArray[i]+']').addClass("searched");
}
}REA
}
},

Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"adobe-panel-dev-packagejson": "sync-files ./package.json ~/Library/Application\\ Support/Adobe/CEP/extensions/autoedit2-panel/package.json",
"adobe-panel-dev-node_modules": "sync-files node_modules ~/Library/Application\\ Support/Adobe/CEP/extensions/autoedit2-panel/node_modules",
"adobe-panel-dev": "npm run make_js && npm run adobe-panel-dev-src && npm run adobe-panel-dev-electron && npm run adobe-panel-dev-lib && npm run adobe-panel-dev-node_modules && npm run adobe-panel-dev-packagejson",
"adobe-panel-dev:watch": "onchange ./lib/** ./package.json ./electron/** ./adobe-panel-src/** -e ./electron/app.js -- npm run adobe-panel-dev"
"adobe-panel-dev:watch": "onchange ./lib/** ./package.json ./electron/** ./adobe-panel-src/** -e ./electron/app.js -- npm run adobe-panel-dev",
"adobe-panel-build": "sync-files adobe-panel-src adobe-panel-build && sync-files electron adobe-panel-build/electron && sync-files lib adobe-panel-build/lib && sync-files ./package.json adobe-panel-build/package.json && sync-files node_modules adobe-panel-build/node_modules",
"adobe-panel-package-sign-build": "node sign-and-package-adobe-panel.js"
},
"build": {
"appId": "org.autoEdit2.autoEdit2-electron",
Expand Down Expand Up @@ -161,6 +163,7 @@
"browserify-shim": "^3.8.12",
"copy-dir": "^0.3.0",
"docco": "^0.7.0",
"dotenv": "^6.0.0",
"electron": "^1.6.10",
"electron-builder": "*",
"electron-packager": "*",
Expand Down
59 changes: 59 additions & 0 deletions sign-and-package-adobe-panel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* Build script to package and sign Adobe CEP panel.
* uses .env for inputs
* Example, `.env` file
ZXPSignCmd_PATH="./ccextensionsmac/ZXPSignCmd"
COUNTRY_CODE=UK
STATE_OR_PROVINCE=London
ORGANIZATION=""
COMMON_NAME=""
CERTIFICATE_PASSWORD=""
CERTIFICATE_OUTPUT_PATH="./ccextensionsmac/certificate.p12"
INPUT_DIRECTORY="./adobe-panel-build"
OUTPUT_ZXP="./dist/com.autoedit2.it.zxp"
TIMESTAMPS_URL="http://timestamp.digicert.com/"
* `./ccextensionsmac/certificate.p12` is in gitignore to avoid accidentally commiting your certificate.
*/
require('dotenv').config();
const { exec } = require('child_process');

console.log("Starting script");
// package all files and folders needed inside adobe-panel-build folder
exec('npm run adobe-panel-build', (err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
console.error(err);
return;
}
console.log('moved files to adobe-panel-build ');

// TODO:
// delete certificate if present
// delete ./dist/com.autoEdit2.it.zxp file

// creating a certificate
// ZXPSignCmd -selfSignedCert <countryCode> <stateOrProvince> <organization> <commonName> <password> <outputPath.p12>
exec(`${process.env.ZXPSignCmd_PATH} -selfSignedCert ${process.env.COUNTRY_CODE} ${process.env.STATE_OR_PROVINCE} ${process.env.ORGANIZATION} "${process.env.COMMON_NAME}" ${process.env.CERTIFICATE_PASSWORD} ${process.env.CERTIFICATE_OUTPUT_PATH}`, (err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
console.error(err);
return;
}
// the *entire* stdout and stderr (buffered)
// console.log(`stdout: ${stdout}`);
// console.log(`stderr: ${stderr}`);
console.log('created certificate ');
// pack and sign the extension
// ZXPSignCmd -sign <inputDirectory> <outputZxp> <p12> <p12Password> -tsa <timestampURL>
exec(`${process.env.ZXPSignCmd_PATH} -sign ${process.env.INPUT_DIRECTORY} ${process.env.OUTPUT_ZXP} ${process.env.CERTIFICATE_OUTPUT_PATH} ${process.env.CERTIFICATE_PASSWORD} -tsa ${process.env.TIMESTAMPS_URL}`, (err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
console.error(err);
return;
}
console.log(`packaged app in ${process.env.OUTPUT_ZXP}`);
});
});
});

0 comments on commit 90be899

Please sign in to comment.