feat(package): fix build-resources-task and move submodule

This commit is contained in:
Evan Morikawa 2016-04-25 15:27:21 -07:00
parent 2472e0556b
commit 60d2c24693
10 changed files with 27 additions and 15 deletions

2
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "build/resources/nylas"] [submodule "build/resources/nylas"]
path = build/resources/nylas path = src/pro
url = git@github.com:nylas/edgehill.git url = git@github.com:nylas/edgehill.git

View file

@ -41,9 +41,9 @@ before_install:
chmod 400 ~/.ssh/id_rsa; chmod 400 ~/.ssh/id_rsa;
ssh-keyscan github.com >> ~/.ssh/known_hosts; ssh-keyscan github.com >> ~/.ssh/known_hosts;
git submodule update --init --recursive; git submodule update --init --recursive;
2>/dev/null 1>/dev/null openssl aes-256-cbc -K $encrypted_d583b56b822e_key -iv $encrypted_d583b56b822e_iv -in build/resources/nylas/encrypted_certificates/travis/travis-files.tar.enc -out build/resources/nylas/encrypted_certificates/travis/travis-files.tar -d; 2>/dev/null 1>/dev/null openssl aes-256-cbc -K $encrypted_d583b56b822e_key -iv $encrypted_d583b56b822e_iv -in src/pro/encrypted_certificates/travis/travis-files.tar.enc -out src/pro/encrypted_certificates/travis/travis-files.tar -d;
mkdir build/resources/certs; mkdir build/resources/certs;
2>/dev/null 1>/dev/null tar xvf build/resources/nylas/encrypted_certificates/travis/travis-files.tar --directory=build/resources/certs/; 2>/dev/null 1>/dev/null tar xvf src/pro/encrypted_certificates/travis/travis-files.tar --directory=build/resources/certs/;
2>/dev/null 1>/dev/null source build/resources/certs/set_unix_env.sh; 2>/dev/null 1>/dev/null source build/resources/certs/set_unix_env.sh;
fi fi

View file

@ -36,9 +36,9 @@ install:
# http://stackoverflow.com/questions/21002919/running-a-remote-powershell-script-with-a-git-command-in-it-results-in-nativecom # http://stackoverflow.com/questions/21002919/running-a-remote-powershell-script-with-a-git-command-in-it-results-in-nativecom
Start-Process -FilePath git.exe -ArgumentList 'submodule update' -Wait -NoNewWindow Start-Process -FilePath git.exe -ArgumentList 'submodule update' -Wait -NoNewWindow
secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\win-nylas-n1.p12.enc -secret $env:DECRYPTION_PASSWORD secure-file\tools\secure-file -decrypt src\pro\encrypted_certificates\appveyor\win-nylas-n1.p12.enc -secret $env:DECRYPTION_PASSWORD
secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1.enc -secret $env:DECRYPTION_PASSWORD secure-file\tools\secure-file -decrypt src\pro\encrypted_certificates\appveyor\set_win_env.ps1.enc -secret $env:DECRYPTION_PASSWORD
. build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1 . src\pro\encrypted_certificates\appveyor\set_win_env.ps1
} }
build_script: build_script:
@ -49,7 +49,7 @@ environment:
- NODE_VERSION: 0.12 - NODE_VERSION: 0.12
PUBLISH_BUILD: true PUBLISH_BUILD: true
global: global:
CERTIFICATE_FILE: .\build\resources\nylas\encrypted_certificates\appveyor\win-nylas-n1.p12 CERTIFICATE_FILE: .\src\pro\encrypted_certificates\appveyor\win-nylas-n1.p12
DECRYPTION_PASSWORD: DECRYPTION_PASSWORD:
secure: 48VSzDtdBd52Xlo3TZ1NeR1yRRrZ3AU6Px5XjD5RDp44cFU5GYVspecGqX6DGCV7i0D7nldGMyEbXNrjM1t1Kw== secure: 48VSzDtdBd52Xlo3TZ1NeR1yRRrZ3AU6Px5XjD5RDp44cFU5GYVspecGqX6DGCV7i0D7nldGMyEbXNrjM1t1Kw==

View file

@ -9,7 +9,7 @@ babelOptions = require '../static/babelrc'
# packages in the root-level node_modules are compiled against Chrome's v8 # packages in the root-level node_modules are compiled against Chrome's v8
# headers. # headers.
# #
# See build/resources/nylas/docs/ContinuousIntegration.md for more detailed # See src/pro/docs/ContinuousIntegration.md for more detailed
# instructions on how we build N1. # instructions on how we build N1.
# #
# Some useful grunt options are: # Some useful grunt options are:

@ -1 +0,0 @@
Subproject commit 7bcb1918054cad23fd217dff38df6596b52ee87b

View file

@ -3,7 +3,7 @@ path = require 'path'
module.exports = (grunt) -> module.exports = (grunt) ->
{cp, mkdir, rm} = require('./task-helpers')(grunt) {cp, mkdir, rm} = require('./task-helpers')(grunt)
rootDir = path.resolve(path.join('../', 'internal_packages', 'pro')) rootDir = path.resolve(path.join('../', 'src', 'pro'))
copyArcFiles = -> copyArcFiles = ->
cp path.join(rootDir, 'arc-N1', '.arcconfig'), '.arcconfig' cp path.join(rootDir, 'arc-N1', '.arcconfig'), '.arcconfig'
@ -13,6 +13,18 @@ module.exports = (grunt) ->
copySourceExtensions = -> copySourceExtensions = ->
cp path.join(rootDir, 'src'), 'src' cp path.join(rootDir, 'src'), 'src'
linkPlugins = ->
for plugin in fs.readdirSync(path.join(rootDir, 'packages'))
from = path.join(rootDir, 'packages', plugin)
to = path.join(path.resolve('internal_packages'), plugin)
if fs.lstatSync(to)
grunt.log.writeln "Removing old symlink at #{to}"
fs.unlinkSync(to)
grunt.log.writeln "Adding '#{plugin}' to internal_packages"
fs.symlinkSync(from, to, 'dir')
desc = 'Adds in proprietary Nylas packages, fonts, and sounds to N1' desc = 'Adds in proprietary Nylas packages, fonts, and sounds to N1'
grunt.registerTask 'add-nylas-build-resources', desc, -> grunt.registerTask 'add-nylas-build-resources', desc, ->
canaryFileExists = fs.existsSync(path.join(rootDir, "README.md")) canaryFileExists = fs.existsSync(path.join(rootDir, "README.md"))
@ -23,3 +35,4 @@ module.exports = (grunt) ->
grunt.log.writeln "Found proprietary Nylas plugins" grunt.log.writeln "Found proprietary Nylas plugins"
copyArcFiles() copyArcFiles()
copySourceExtensions() copySourceExtensions()
linkPlugins()

View file

@ -11,5 +11,8 @@
"dependencies": { "dependencies": {
"clearbit": "^1.2" "clearbit": "^1.2"
}, },
"engines": {
"nylas": "*"
},
"license": "GPL-3.0" "license": "GPL-3.0"
} }

View file

@ -43,7 +43,6 @@ class PackageManager
@packageDirPaths.push(path.join(@resourcePath, "spec", "fixtures", "packages")) @packageDirPaths.push(path.join(@resourcePath, "spec", "fixtures", "packages"))
else else
@packageDirPaths.push(path.join(@resourcePath, "internal_packages")) @packageDirPaths.push(path.join(@resourcePath, "internal_packages"))
@packageDirPaths.push(path.join(@resourcePath, "internal_packages", "pro"))
if not safeMode if not safeMode
if @devMode if @devMode
@packageDirPaths.push(path.join(configDirPath, "dev", "packages")) @packageDirPaths.push(path.join(configDirPath, "dev", "packages"))
@ -316,9 +315,8 @@ class PackageManager
try try
metadata = Package.loadMetadata(packagePath) ? {} metadata = Package.loadMetadata(packagePath) ? {}
if not (metadata.engines?.nylas) and not (/pro/.test(packagePath)) if not (metadata.engines?.nylas)
console.error("INVALID PACKAGE: Your package at #{packagePath} does not have a properly formatted `package.json`. You must include an {'engines': {'nylas': version}} property") console.error("INVALID PACKAGE: Your package at #{packagePath} does not have a properly formatted `package.json`. You must include an {'engines': {'nylas': version}} property")
return false
{windowTypes} = metadata {windowTypes} = metadata
if windowTypes if windowTypes

View file

@ -42,8 +42,6 @@ class Package
metadata = JSON.parse(fs.readFileSync(metadataPath)) metadata = JSON.parse(fs.readFileSync(metadataPath))
catch error catch error
throw error unless ignoreErrors throw error unless ignoreErrors
else
return null
metadata ?= {} metadata ?= {}
metadata.name = packageName metadata.name = packageName

1
src/pro Submodule

@ -0,0 +1 @@
Subproject commit 8a673415fc941615d453fc4f159eef649aaaabd5