aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2015-11-12 13:18:59 -0500
committerTimmy Willison <timmywillisn@gmail.com>2015-11-16 11:22:20 -0500
commitcf7102c3f1bcbd135f24947a3a3216cff272bdc2 (patch)
tree6a51615585760bb0831db372c5df93c5d5632277
parent78b9eac1198627eb4dad0cc35334c7704449f310 (diff)
downloadjquery-cf7102c3f1bcbd135f24947a3a3216cff272bdc2.tar.gz
jquery-cf7102c3f1bcbd135f24947a3a3216cff272bdc2.zip
Release: push a custom slim build to the CDN
Fixes gh-2653 Close gh-2711
-rw-r--r--Gruntfile.js10
-rw-r--r--build/release.js16
-rw-r--r--build/release/cdn.js19
-rw-r--r--build/release/dist.js21
-rw-r--r--build/tasks/build.js8
-rw-r--r--build/tasks/dist.js9
-rw-r--r--build/tasks/sourcemap.js3
7 files changed, 55 insertions, 31 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index dd4b07d30..626531b29 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -31,6 +31,10 @@ module.exports = function( grunt ) {
// But our modules can
delete srcHintOptions.onevar;
+ if ( !grunt.option( "filename" ) ) {
+ grunt.option( "filename", "jquery.js" );
+ }
+
grunt.initConfig( {
pkg: grunt.file.readJSON( "package.json" ),
dst: readOptionalJSON( "dist/.destination.json" ),
@@ -173,12 +177,14 @@ module.exports = function( grunt ) {
uglify: {
all: {
files: {
- "dist/jquery.min.js": [ "dist/jquery.js" ]
+ "dist/<%= grunt.option('filename').replace('.js', '.min.js') %>":
+ "dist/<%= grunt.option('filename') %>"
},
options: {
preserveComments: false,
sourceMap: true,
- sourceMapName: "dist/jquery.min.map",
+ sourceMapName:
+ "dist/<%= grunt.option('filename').replace('.js', '.min.map') %>",
report: "min",
beautify: {
"ascii_only": true
diff --git a/build/release.js b/build/release.js
index 5feddfa24..a333d05b4 100644
--- a/build/release.js
+++ b/build/release.js
@@ -2,7 +2,14 @@
module.exports = function( Release ) {
var
- files = [ "dist/jquery.js", "dist/jquery.min.js", "dist/jquery.min.map" ],
+ files = [
+ "dist/jquery.js",
+ "dist/jquery.min.js",
+ "dist/jquery.min.map",
+ "dist/jquery.slim.js",
+ "dist/jquery.slim.min.js",
+ "dist/jquery.slim.min.map"
+ ],
cdn = require( "./release/cdn" ),
dist = require( "./release/dist" ),
ensureSizzle = require( "./release/ensure-sizzle" ),
@@ -27,6 +34,11 @@ module.exports = function( Release ) {
*/
generateArtifacts: function( callback ) {
Release.exec( "grunt", "Grunt command failed" );
+ Release.exec(
+ "grunt custom:-ajax,-effects,-deprecated --filename=jquery.slim.js && " +
+ "grunt remove_map_comment --filename=jquery.slim.js",
+ "Grunt custom failed"
+ );
cdn.makeReleaseCopies( Release );
callback( files );
},
@@ -47,7 +59,7 @@ module.exports = function( Release ) {
*/
dist: function( callback ) {
cdn.makeArchives( Release, function() {
- dist( Release, callback );
+ dist( Release, files, callback );
} );
}
} );
diff --git a/build/release/cdn.js b/build/release/cdn.js
index 07285a56d..3b485112e 100644
--- a/build/release/cdn.js
+++ b/build/release/cdn.js
@@ -5,22 +5,23 @@ var
cdnFolder = "dist/cdn",
- devFile = "dist/jquery.js",
- minFile = "dist/jquery.min.js",
- mapFile = "dist/jquery.min.map",
-
releaseFiles = {
- "jquery-VER.js": devFile,
- "jquery-VER.min.js": minFile,
- "jquery-VER.min.map": mapFile
+ "jquery-VER.js": "dist/jquery.js",
+ "jquery-VER.min.js": "dist/jquery.min.js",
+ "jquery-VER.min.map": "dist/jquery.min.map",
+ "jquery-VER.slim.js": "dist/jquery.slim.js",
+ "jquery-VER.slim.min.js": "dist/jquery.slim.min.js",
+ "jquery-VER.slim.min.map": "dist/jquery.slim.min.map"
},
googleFilesCDN = [
- "jquery.js", "jquery.min.js", "jquery.min.map"
+ "jquery.js", "jquery.min.js", "jquery.min.map",
+ "jquery.slim.js", "jquery.slim.min.js", "jquery.slim.min.map"
],
msFilesCDN = [
- "jquery-VER.js", "jquery-VER.min.js", "jquery-VER.min.map"
+ "jquery-VER.js", "jquery-VER.min.js", "jquery-VER.min.map",
+ "jquery-VER.slim.js", "jquery-VER.slim.min.js", "jquery-VER.slim.min.map"
];
/**
diff --git a/build/release/dist.js b/build/release/dist.js
index 32053eafb..514d40739 100644
--- a/build/release/dist.js
+++ b/build/release/dist.js
@@ -1,13 +1,16 @@
-module.exports = function( Release, complete ) {
+module.exports = function( Release, files, complete ) {
var
fs = require( "fs" ),
shell = require( "shelljs" ),
pkg = require( Release.dir.repo + "/package.json" ),
- distRemote = Release.remote.replace( "jquery.git", "jquery-dist.git" ),
+ distRemote = Release.remote
+
+ // For local and github dists
+ .replace( /jquery(\.git|$)/, "jquery-dist$1" ),
// These files are included with the distribution
- files = [
+ extras = [
"src",
"LICENSE.txt",
"AUTHORS.txt",
@@ -54,17 +57,13 @@ module.exports = function( Release, complete ) {
// Copy dist files
var distFolder = Release.dir.dist + "/dist";
shell.mkdir( "-p", distFolder );
- [
- "dist/jquery.js",
- "dist/jquery.min.js",
- "dist/jquery.min.map"
- ].forEach( function( file ) {
- shell.cp( Release.dir.repo + "/" + file, distFolder );
+ files.forEach( function( file ) {
+ shell.cp( "-f", Release.dir.repo + "/" + file, distFolder );
} );
// Copy other files
- files.forEach( function( file ) {
- shell.cp( "-r", Release.dir.repo + "/" + file, Release.dir.dist );
+ extras.forEach( function( file ) {
+ shell.cp( "-rf", Release.dir.repo + "/" + file, Release.dir.dist );
} );
// Write generated bower file
diff --git a/build/tasks/build.js b/build/tasks/build.js
index 74fa47fde..c9f1daeb8 100644
--- a/build/tasks/build.js
+++ b/build/tasks/build.js
@@ -15,7 +15,6 @@ module.exports = function( grunt ) {
config = {
baseUrl: "src",
name: "jquery",
- out: "dist/jquery.js",
// We have multiple minify steps
optimize: "none",
@@ -115,7 +114,7 @@ module.exports = function( grunt ) {
done = this.async(),
flags = this.flags,
optIn = flags[ "*" ],
- name = this.data.dest,
+ name = grunt.option( "filename" ),
minimum = this.data.minimum,
removeWith = this.data.removeWith,
excluded = [],
@@ -205,6 +204,11 @@ module.exports = function( grunt ) {
}
};
+ // Filename can be passed to the command line using
+ // command line options
+ // e.g. grunt build --filename=jquery-custom.js
+ name = name ? ( "dist/" + name ) : this.data.dest;
+
// append commit id to version
if ( process.env.COMMIT ) {
version += " " + process.env.COMMIT;
diff --git a/build/tasks/dist.js b/build/tasks/dist.js
index 78ce2f254..fa6920c88 100644
--- a/build/tasks/dist.js
+++ b/build/tasks/dist.js
@@ -2,11 +2,12 @@ module.exports = function( grunt ) {
"use strict";
- var fs = require( "fs" ),
+ var fs = require( "fs" ),
+ filename = grunt.option( "filename" ),
distpaths = [
- "dist/jquery.js",
- "dist/jquery.min.map",
- "dist/jquery.min.js"
+ "dist/" + filename,
+ "dist/" + filename.replace( ".js", ".min.map" ),
+ "dist/" + filename.replace( ".js", ".min.js" )
];
// Process files for distribution
diff --git a/build/tasks/sourcemap.js b/build/tasks/sourcemap.js
index 3e4144de0..3f21b2afd 100644
--- a/build/tasks/sourcemap.js
+++ b/build/tasks/sourcemap.js
@@ -1,8 +1,9 @@
var fs = require( "fs" );
module.exports = function( grunt ) {
- var minLoc = Object.keys( grunt.config( "uglify.all.files" ) )[ 0 ];
+ var config = grunt.config( "uglify.all.files" );
grunt.registerTask( "remove_map_comment", function() {
+ var minLoc = grunt.config.process( Object.keys( config )[ 0 ] );
// Remove the source map comment; it causes way too many problems.
// The map file is still generated for manual associations
ackport/47847/stable30 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/ContactsManager.php
blob: 6a83a718d419bec9c795114471e4a6a96383e265 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190