-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdspm.config.js
31 lines (27 loc) · 1.29 KB
/
dspm.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const { join } = require('path');
const { ArchiveTask } = require('./build/dist/main/tasks/ArchiveTask');
const { DependencyResolveTask } = require('./build/dist/main/tasks/DependencyResolveTask');
const { InstallTask } = require('./build/dist/main/tasks/InstallTask');
const { NpmScriptTask } = require('./build/dist/main/tasks/NpmScriptTask');
const { FSLockProvider } = require('./build/dist/main/caches/FSLockProvider');
module.exports = (project) => {
const lockProviders = project.ensureNameSpace('lock_providers');
lockProviders.setItem('prod', new FSLockProvider(join(project.getProjectPath(), 'dspm.prod.lock.json')));
DependencyResolveTask.create(project, 'dependencyProd')
.lockProvider('prod')
.dependencies(require('./package').dependencies);
InstallTask.create(project, 'installDist')
.resolveTask('dependencyProd')
.targetPath('./build/dist');
NpmScriptTask.create(project, 'processBin')
.installTask('installDist')
.command('node scripts/processDspm.js && chmod +x build/dspm')
.env('DSPM_VERSION', process.env.TRAVIS_TAG || 'local');
ArchiveTask.create(project, 'distArchive')
.from('./build/dist')
.from('.', { entries: ['package.json'] })
.into('build/dspm.tar.gz')
.useGzip()
.dependsOn('installDist')
.dependsOn('processBin');
};