mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Merge pull request #1551 from atom/ns-licenses
Check that all bundled modules have permissive licenses during CI build
This commit is contained in:
13
LICENSE.md
13
LICENSE.md
@@ -1,13 +0,0 @@
|
||||
Copyright 2013 GitHub Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -227,6 +227,6 @@ module.exports = (grunt) ->
|
||||
grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson', 'peg'])
|
||||
grunt.registerTask('lint', ['coffeelint', 'csslint', 'lesslint'])
|
||||
grunt.registerTask('test', ['shell:kill-atom', 'run-specs'])
|
||||
grunt.registerTask('ci', ['output-disk-space', 'download-atom-shell', 'build', 'set-version', 'lint', 'test', 'codesign', 'publish-build'])
|
||||
grunt.registerTask('ci', ['output-disk-space', 'download-atom-shell', 'build', 'set-version', 'check-licenses', 'lint', 'test', 'codesign', 'publish-build'])
|
||||
grunt.registerTask('docs', ['markdown:guides', 'build-docs'])
|
||||
grunt.registerTask('default', ['download-atom-shell', 'build', 'set-version', 'install'])
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"grunt-shell": "~0.3.1",
|
||||
"harmony-collections": "~0.3.8",
|
||||
"json-front-matter": "~0.1.3",
|
||||
"legal-eagle": "~0.3.0",
|
||||
"rcedit": "~0.1.2",
|
||||
"request": "~2.27.0",
|
||||
"rimraf": "~2.2.2",
|
||||
|
||||
@@ -74,7 +74,7 @@ module.exports = (grunt) ->
|
||||
unless /.+\.plist/.test(sourcePath)
|
||||
grunt.file.copy(sourcePath, path.resolve(appDir, '..', subDirectory, filename))
|
||||
|
||||
dependencies = ['compile']
|
||||
dependencies = ['compile', "generate-license:save"]
|
||||
dependencies.push('copy-info-plist') if process.platform is 'darwin'
|
||||
dependencies.push('set-exe-icon') if process.platform is 'win32'
|
||||
grunt.task.run(dependencies...)
|
||||
|
||||
31
build/tasks/check-licenses-task.coffee
Normal file
31
build/tasks/check-licenses-task.coffee
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
module.exports = (grunt) ->
|
||||
grunt.registerTask 'check-licenses', 'Report the licenses of all dependencies', ->
|
||||
legalEagle = require 'legal-eagle'
|
||||
{size, keys} = require 'underscore-plus'
|
||||
done = @async()
|
||||
|
||||
options =
|
||||
path: process.cwd()
|
||||
omitPermissive: true
|
||||
overrides: require './license-overrides'
|
||||
|
||||
legalEagle options, (err, summary) ->
|
||||
if err?
|
||||
console.error(err)
|
||||
exit 1
|
||||
|
||||
# Omit failure for coffee-script bundle for now. It seems to be intended
|
||||
# to be open source but has no license.
|
||||
for dependencyName in keys(summary)
|
||||
if dependencyName.match /^language-coffee-script@/
|
||||
delete summary[dependencyName]
|
||||
|
||||
if size(summary)
|
||||
console.error "Found dependencies without permissive licenses:"
|
||||
for name in keys(summary).sort()
|
||||
console.error "#{name}"
|
||||
console.error " License: #{summary[name].license}"
|
||||
console.error " Repository: #{summary[name].repository}"
|
||||
process.exit 1
|
||||
done()
|
||||
46
build/tasks/generate-license-task.coffee
Normal file
46
build/tasks/generate-license-task.coffee
Normal file
@@ -0,0 +1,46 @@
|
||||
fs = require 'fs'
|
||||
path = require 'path'
|
||||
|
||||
module.exports = (grunt) ->
|
||||
grunt.registerTask 'generate-license', 'Generate the license, including the licenses of all dependencies', (mode) ->
|
||||
legalEagle = require 'legal-eagle'
|
||||
done = @async()
|
||||
|
||||
options =
|
||||
path: process.cwd()
|
||||
overrides: require './license-overrides'
|
||||
|
||||
legalEagle options, (err, dependencyLicenses) ->
|
||||
if err?
|
||||
console.error(err)
|
||||
exit 1
|
||||
|
||||
licenseText = getLicenseText(dependencyLicenses)
|
||||
if mode is 'save'
|
||||
targetPath = path.join(grunt.config.get('atom.appDir'), 'LICENSE')
|
||||
fs.writeFileSync(targetPath, licenseText)
|
||||
else
|
||||
console.log licenseText
|
||||
done()
|
||||
|
||||
getLicenseText = (dependencyLicenses) ->
|
||||
{keys} = require 'underscore-plus'
|
||||
text = """
|
||||
Copyright 2014 GitHub, Inc.
|
||||
|
||||
This application bundles the following third-party packages in accordance
|
||||
with the following licenses:\n\n
|
||||
"""
|
||||
names = keys(dependencyLicenses).sort()
|
||||
for name in names
|
||||
{license, source, sourceText} = dependencyLicenses[name]
|
||||
|
||||
text += "-------------------------------------------------------------------------\n\n"
|
||||
text += "Package: #{name}\n"
|
||||
text += "License: #{license}\n"
|
||||
text += "License Source: #{source}\n" if source?
|
||||
if sourceText?
|
||||
text += "Source Text:\n\n"
|
||||
text += sourceText
|
||||
text += '\n'
|
||||
text
|
||||
62
build/tasks/license-overrides.coffee
Normal file
62
build/tasks/license-overrides.coffee
Normal file
@@ -0,0 +1,62 @@
|
||||
module.exports =
|
||||
'aws-sign@0.3.0':
|
||||
repository: 'https://github.com/mikeal/aws-sign'
|
||||
license: 'MIT'
|
||||
source: 'index.js'
|
||||
sourceText: """
|
||||
/*!
|
||||
* knox - auth
|
||||
* Copyright(c) 2010 LearnBoost <dev@learnboost.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
<content omitted>
|
||||
"""
|
||||
'bufferjs@2.0.0':
|
||||
repository: 'https://github.com/coolaj86/node-bufferjs'
|
||||
license: 'MIT'
|
||||
source: 'LICENSE.MIT'
|
||||
sourceText: """
|
||||
Copyright (c) 2010 AJ ONeal (and Contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
"""
|
||||
'buffers@0.1.1':
|
||||
repository: "http://github.com/substack/node-buffers"
|
||||
license: 'MIT'
|
||||
source: 'README.markdown'
|
||||
sourceText: """
|
||||
<content omitted>
|
||||
license
|
||||
=======
|
||||
|
||||
MIT/X11
|
||||
"""
|
||||
'specificity@0.1.3':
|
||||
repository: 'https://github.com/keeganstreet/specificity'
|
||||
license: 'MIT'
|
||||
source: 'package.json in repository'
|
||||
|
||||
'promzard@0.2.0':
|
||||
license: 'ISC'
|
||||
source: 'LICENSE in the repository'
|
||||
sourceText: """
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
"""
|
||||
@@ -3,6 +3,7 @@
|
||||
label: 'Atom'
|
||||
submenu: [
|
||||
{ label: 'About Atom', command: 'application:about' }
|
||||
{ label: 'View License', command: 'application:open-license' }
|
||||
{ label: "VERSION", enabled: false }
|
||||
{ label: "Restart and Install Update", command: 'application:install-update', visible: false}
|
||||
{ label: "Check for Update", command: 'application:check-for-update', visible: false}
|
||||
|
||||
@@ -145,6 +145,7 @@
|
||||
label: '&Help'
|
||||
submenu: [
|
||||
{ label: '&About Atom...', command: 'application:about' }
|
||||
{ label: 'View &License', command: 'application:open-license' }
|
||||
{ label: "VERSION", enabled: false }
|
||||
{ label: "Install &update", command: 'application:install-update', visible: false }
|
||||
{ type: 'separator' }
|
||||
|
||||
56
package.json
56
package.json
@@ -20,7 +20,7 @@
|
||||
"dependencies": {
|
||||
"async": "0.2.6",
|
||||
"bootstrap": "git://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
|
||||
"clear-cut": "0.2.0",
|
||||
"clear-cut": "0.4.0",
|
||||
"coffee-script": "1.7.0",
|
||||
"coffeestack": "0.7.0",
|
||||
"delegato": "1.x",
|
||||
@@ -45,7 +45,7 @@
|
||||
"q": "1.0.x",
|
||||
"random-words": "0.0.1",
|
||||
"runas": "0.5.x",
|
||||
"scandal": "0.14.0",
|
||||
"scandal": "0.15.0",
|
||||
"season": "1.x",
|
||||
"semver": "1.1.4",
|
||||
"serializable": "1.x",
|
||||
@@ -85,11 +85,11 @@
|
||||
"image-view": "0.24.0",
|
||||
"keybinding-resolver": "0.10.0",
|
||||
"link": "0.17.0",
|
||||
"markdown-preview": "0.33.0",
|
||||
"markdown-preview": "0.34.0",
|
||||
"metrics": "0.26.0",
|
||||
"open-on-github": "0.20.0",
|
||||
"package-generator": "0.26.0",
|
||||
"release-notes": "0.20.0",
|
||||
"release-notes": "0.22.0",
|
||||
"settings-view": "0.77.0",
|
||||
"snippets": "0.30.0",
|
||||
"spell-check": "0.25.0",
|
||||
@@ -103,39 +103,35 @@
|
||||
"welcome": "0.4.0",
|
||||
"whitespace": "0.14.0",
|
||||
"wrap-guide": "0.14.0",
|
||||
"language-c": "0.8.0",
|
||||
"language-clojure": "0.2.0",
|
||||
"language-c": "0.10.0",
|
||||
"language-coffee-script": "0.10.0",
|
||||
"language-css": "0.7.0",
|
||||
"language-css": "0.8.0",
|
||||
"language-gfm": "0.17.0",
|
||||
"language-git": "0.6.0",
|
||||
"language-git": "0.8.0",
|
||||
"language-go": "0.4.0",
|
||||
"language-html": "0.5.0",
|
||||
"language-hyperlink": "0.5.0",
|
||||
"language-java": "0.5.0",
|
||||
"language-javascript": "0.8.0",
|
||||
"language-json": "0.5.0",
|
||||
"language-html": "0.7.0",
|
||||
"language-hyperlink": "0.7.0",
|
||||
"language-java": "0.7.0",
|
||||
"language-javascript": "0.10.0",
|
||||
"language-json": "0.7.0",
|
||||
"language-less": "0.4.0",
|
||||
"language-make": "0.4.0",
|
||||
"language-mustache": "0.3.0",
|
||||
"language-objective-c": "0.5.0",
|
||||
"language-pegjs": "0.3.0",
|
||||
"language-perl": "0.5.0",
|
||||
"language-php": "0.6.0",
|
||||
"language-property-list": "0.5.0",
|
||||
"language-puppet": "0.5.0",
|
||||
"language-python": "0.5.0",
|
||||
"language-ruby": "0.11.0",
|
||||
"language-make": "0.6.0",
|
||||
"language-objective-c": "0.8.0",
|
||||
"language-perl": "0.7.0",
|
||||
"language-php": "0.7.0",
|
||||
"language-property-list": "0.6.0",
|
||||
"language-python": "0.6.0",
|
||||
"language-ruby": "0.12.0",
|
||||
"language-ruby-on-rails": "0.6.0",
|
||||
"language-sass": "0.6.0",
|
||||
"language-shellscript": "0.5.0",
|
||||
"language-source": "0.5.0",
|
||||
"language-sql": "0.5.0",
|
||||
"language-text": "0.4.0",
|
||||
"language-todo": "0.4.0",
|
||||
"language-shellscript": "0.6.0",
|
||||
"language-source": "0.6.0",
|
||||
"language-sql": "0.6.0",
|
||||
"language-text": "0.5.0",
|
||||
"language-todo": "0.5.0",
|
||||
"language-toml": "0.9.0",
|
||||
"language-xml": "0.5.0",
|
||||
"language-yaml": "0.4.0"
|
||||
"language-xml": "0.6.0",
|
||||
"language-yaml": "0.5.0"
|
||||
},
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -230,3 +230,8 @@ describe "Workspace", ->
|
||||
expect(atom.config.get('editor.fontSize')).toBe 1
|
||||
workspace.decreaseFontSize()
|
||||
expect(atom.config.get('editor.fontSize')).toBe 1
|
||||
|
||||
describe "::openLicense()", ->
|
||||
it "opens the license as plain-text in a buffer", ->
|
||||
waitsForPromise -> workspace.openLicense()
|
||||
runs -> expect(workspace.activePaneItem.getText()).toMatch /Copyright/
|
||||
|
||||
@@ -111,6 +111,7 @@ class WorkspaceView extends View
|
||||
@command 'application:open-your-keymap', -> ipc.sendChannel('command', 'application:open-your-keymap')
|
||||
@command 'application:open-your-snippets', -> ipc.sendChannel('command', 'application:open-your-snippets')
|
||||
@command 'application:open-your-stylesheet', -> ipc.sendChannel('command', 'application:open-your-stylesheet')
|
||||
@command 'application:open-license', => @model.openLicense()
|
||||
|
||||
@command 'window:install-shell-commands', => @installShellCommands()
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{remove, last} = require 'underscore-plus'
|
||||
{join} = require 'path'
|
||||
{Model} = require 'theorist'
|
||||
Q = require 'q'
|
||||
Serializable = require 'serializable'
|
||||
@@ -88,6 +89,9 @@ class Workspace extends Model
|
||||
|
||||
@openUriInPane(uri, pane, options)
|
||||
|
||||
openLicense: ->
|
||||
@open(join(atom.getLoadSettings().resourcePath, 'LICENSE'))
|
||||
|
||||
# Only used in specs
|
||||
openSync: (uri='', options={}) ->
|
||||
{initialLine} = options
|
||||
|
||||
Reference in New Issue
Block a user