Skip to content

Commit b451417

Browse files
committed
manually build jsrsasign
1 parent 687f357 commit b451417

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+10171
-22
lines changed

gulpfile.js

Lines changed: 88 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var webpack = require('webpack');
44
var createWebpackConfig = require('./webpack.base');
55

66
// entry points for both configs
7-
var npmEntry = './index.js';
7+
var npmEntry ='./index.js';
88
var classicEntry = ['babel-polyfill', npmEntry];
99

1010
// uglify plugin for minification
@@ -18,28 +18,28 @@ var uglifyPlugins = [
1818
];
1919

2020
// npm compliant build with source-maps
21-
gulp.task('build-lib-sourcemap', function() {
21+
gulp.task('build-lib-sourcemap', ['jsrsasign'], function() {
2222
// run webpack
23-
gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
23+
return gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
2424
entry: npmEntry,
2525
output: {
26-
filename: 'oidc-client.js',
27-
libraryTarget: 'umd'
26+
filename:'oidc-client.js',
27+
libraryTarget:'umd'
2828
},
2929
plugins: [],
30-
devtool: 'inline-source-map'
30+
devtool:'inline-source-map'
3131
})))
3232
.pipe(gulp.dest('lib/'));
3333
});
3434

3535
// npm compliant build without source-maps & minified
36-
gulp.task('build-lib-min', function() {
36+
gulp.task('build-lib-min', ['jsrsasign'], function() {
3737
// run webpack
38-
gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
38+
return gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
3939
entry: npmEntry,
4040
output: {
41-
filename: 'oidc-client.min.js',
42-
libraryTarget: 'umd',
41+
filename:'oidc-client.min.js',
42+
libraryTarget:'umd',
4343
},
4444
plugins: uglifyPlugins,
4545
devtool: null
@@ -48,36 +48,102 @@ gulp.task('build-lib-min', function() {
4848
});
4949

5050
// classic build with sourcemaps
51-
gulp.task('build-dist-sourcemap', function() {
51+
gulp.task('build-dist-sourcemap', ['jsrsasign'], function() {
5252
// run webpack
53-
gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
53+
return gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
5454
entry: classicEntry,
5555
output: {
56-
filename: 'oidc-client.js',
57-
libraryTarget: 'var',
58-
library: 'Oidc'
56+
filename:'oidc-client.js',
57+
libraryTarget:'var',
58+
library:'Oidc'
5959
},
6060
plugins: [],
61-
devtool: 'inline-source-map'
61+
devtool:'inline-source-map'
6262
})))
6363
.pipe(gulp.dest('dist/'));
6464
});
6565

6666
// classic build without sourcemaps & minified
67-
gulp.task('build-dist-min', function() {
67+
gulp.task('build-dist-min', ['jsrsasign'], function() {
6868
// run webpack
69-
gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
69+
return gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
7070
entry: classicEntry,
7171
output: {
72-
filename: 'oidc-client.min.js',
73-
libraryTarget: 'var',
74-
library: 'Oidc'
72+
filename:'oidc-client.min.js',
73+
libraryTarget:'var',
74+
library:'Oidc'
7575
},
7676
plugins: uglifyPlugins,
7777
devtool: null
7878
})))
7979
.pipe(gulp.dest('dist/'));
8080
});
8181

82+
var gulp = require('gulp'),
83+
useref = require('gulp-useref'),
84+
concat = require('gulp-concat');
85+
86+
87+
var files = [
88+
'jsrsasign/header.js'
89+
90+
,'jsrsasign/ext/yahoo-min.js'
91+
92+
,'jsrsasign/ext/cj/cryptojs-312-core-fix-min.js'
93+
,'jsrsasign/ext/cj/x64-core_min.js'
94+
,'jsrsasign/ext/cj/cipher-core_min.js'
95+
,'jsrsasign/ext/cj/aes_min.js'
96+
,'jsrsasign/ext/cj/tripledes_min.js'
97+
,'jsrsasign/ext/cj/enc-base64_min.js'
98+
,'jsrsasign/ext/cj/md5_min.js'
99+
,'jsrsasign/ext/cj/sha1_min.js'
100+
,'jsrsasign/ext/cj/sha256_min.js'
101+
,'jsrsasign/ext/cj/sha224_min.js'
102+
,'jsrsasign/ext/cj/sha512_min.js'
103+
,'jsrsasign/ext/cj/sha384_min.js'
104+
,'jsrsasign/ext/cj/ripemd160_min.js'
105+
,'jsrsasign/ext/cj/hmac_min.js'
106+
,'jsrsasign/ext/cj/pbkdf2_min.js'
107+
108+
,'jsrsasign/ext/base64-min.js'
109+
,'jsrsasign/ext/jsbn-min.js'
110+
,'jsrsasign/ext/jsbn2-min.js'
111+
,'jsrsasign/ext/prng4-min.js'
112+
,'jsrsasign/ext/rng-min.js'
113+
,'jsrsasign/ext/rsa-min.js'
114+
,'jsrsasign/ext/rsa2-min.js'
115+
,'jsrsasign/ext/ec-min.js'
116+
,'jsrsasign/ext/ec-patch-min.js'
117+
,'jsrsasign/ext/json-sans-eval-min.js'
118+
119+
,'jsrsasign/min/asn1-1.0.min.js'
120+
,'jsrsasign/min/asn1hex-1.1.min.js'
121+
,'jsrsasign/min/asn1x509-1.0.min.js'
122+
,'jsrsasign/min/asn1cms-1.0.min.js'
123+
,'jsrsasign/min/asn1tsp-1.0.min.js'
124+
,'jsrsasign/min/asn1cades-1.0.min.js'
125+
,'jsrsasign/min/asn1csr-1.0.min.js'
126+
,'jsrsasign/min/asn1ocsp-1.0.min.js'
127+
,'jsrsasign/min/base64x-1.1.min.js'
128+
,'jsrsasign/min/crypto-1.1.min.js'
129+
,'jsrsasign/min/ecdsa-modified-1.0.min.js'
130+
,'jsrsasign/min/ecparam-1.0.min.js'
131+
,'jsrsasign/min/dsa-2.0.min.js'
132+
,'jsrsasign/min/keyutil-1.0.min.js'
133+
,'jsrsasign/min/rsapem-1.1.min.js'
134+
,'jsrsasign/min/rsasign-1.2.min.js'
135+
,'jsrsasign/min/x509-1.1.min.js'
136+
,'jsrsasign/min/jws-3.3.min.js'
137+
,'jsrsasign/min/jwsjs-2.0.min.js'
138+
139+
,'jsrsasign/footer.js'
140+
];
141+
142+
gulp.task('jsrsasign', function () {
143+
return gulp.src(files)
144+
.pipe(concat('jsrsasign.js'))
145+
.pipe(gulp.dest('jsrsasign/dist/'));
146+
});
147+
82148
// putting it all together
83-
gulp.task('build', ['build-lib-sourcemap', 'build-lib-min', 'build-dist-sourcemap', 'build-dist-min']);
149+
gulp.task('build', ['build-lib-sourcemap','build-lib-min','build-dist-sourcemap','build-dist-min']);

0 commit comments

Comments
 (0)