Skip to content

Commit b43712e

Browse files
committed
New develop.svn.wordpress.org repository based on the old core.svn repository.
* All WordPress files move to a src/ directory. * New task runner (Grunt), configured to copy a built WordPress to build/. * svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js. * Remove Akismet external from develop.svn. Still exists in core.svn. * Drop minified files from src/. The build process will now generate these. props koop. see #24976. and see http://wp.me/p2AvED-1AI. git-svn-id: https://develop.svn.wordpress.org/trunk@25001 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 5bbd08e commit b43712e

1,219 files changed

Lines changed: 194 additions & 156 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
lib-cov
2+
*.seed
3+
*.log
4+
*.csv
5+
*.dat
6+
*.out
7+
*.pid
8+
*.gz
9+
10+
pids
11+
logs
12+
results
13+
14+
wp-config.php
15+
16+
node_modules
17+
npm-debug.log
18+
19+
# The WordPress output directory.
20+
build

Gruntfile.js

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*global module:false*/
2+
module.exports = function(grunt) {
3+
var path = require('path');
4+
var SOURCE_DIR = 'src/';
5+
var BUILD_DIR = 'build/';
6+
7+
// Project configuration.
8+
grunt.initConfig({
9+
clean: {
10+
all: [BUILD_DIR],
11+
dynamic: {
12+
dot: true,
13+
expand: true,
14+
cwd: BUILD_DIR,
15+
src: []
16+
},
17+
svn: [SOURCE_DIR]
18+
},
19+
copy: {
20+
all: {
21+
dot: true,
22+
expand: true,
23+
cwd: SOURCE_DIR,
24+
src: ['**','!**/.{svn,git}/**'], // Ignore version control directories.
25+
dest: BUILD_DIR
26+
},
27+
dynamic: {
28+
dot: true,
29+
expand: true,
30+
cwd: SOURCE_DIR,
31+
dest: BUILD_DIR,
32+
src: []
33+
}
34+
},
35+
cssmin: {
36+
core: {
37+
expand: true,
38+
cwd: SOURCE_DIR,
39+
dest: BUILD_DIR,
40+
ext: '.min.css',
41+
src: [
42+
'wp-admin/css/*.css',
43+
'wp-includes/css/*.css',
44+
// Exceptions
45+
'!wp-admin/css/farbtastic.css'
46+
]
47+
}
48+
},
49+
svn: {
50+
core: {
51+
repository: 'https://core.svn.wordpress.org/trunk/',
52+
dest: SOURCE_DIR
53+
}
54+
},
55+
uglify: {
56+
core: {
57+
expand: true,
58+
cwd: SOURCE_DIR,
59+
dest: BUILD_DIR,
60+
ext: '.min.js',
61+
src: [
62+
'wp-admin/js/*.js',
63+
'wp-includes/js/*.js',
64+
'wp-includes/js/plupload/handlers.js',
65+
'wp-includes/js/plupload/wp-plupload.js',
66+
'wp-includes/js/tinymce/plugins/wp*/js/*.js',
67+
// Exceptions
68+
'!wp-admin/js/custom-header.js', // Why? We should minify this.
69+
'!wp-admin/js/farbtastic.js',
70+
'!wp-admin/js/iris.min.js',
71+
'!wp-includes/js/backbone.min.js',
72+
'!wp-includes/js/swfobject.js',
73+
'!wp-includes/js/underscore.min.js'
74+
]
75+
},
76+
tinymce: {
77+
expand: true,
78+
cwd: SOURCE_DIR,
79+
dest: BUILD_DIR,
80+
src: [
81+
'wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js',
82+
'wp-includes/js/tinymce/plugins/wp*/editor_plugin_src.js'
83+
],
84+
// TinyMCE plugins use a nonstandard naming scheme: plugin files are named
85+
// `editor_plugin_src.js`, and are compressed into `editor_plugin.js`.
86+
rename: function(destBase, destPath) {
87+
destPath = destPath.replace('/editor_plugin_src.js', '/editor_plugin.js');
88+
return path.join(destBase || '', destPath);
89+
}
90+
}
91+
},
92+
watch: {
93+
all: {
94+
files: [
95+
SOURCE_DIR + '**',
96+
// Ignore version control directories.
97+
'!' + SOURCE_DIR + '**/.{svn,git}/**'
98+
],
99+
tasks: ['clean:dynamic', 'copy:dynamic'],
100+
options: {
101+
dot: true,
102+
spawn: false,
103+
interval: 2000
104+
}
105+
}
106+
}
107+
});
108+
109+
// Load tasks.
110+
grunt.loadNpmTasks('grunt-contrib-clean');
111+
grunt.loadNpmTasks('grunt-contrib-copy');
112+
grunt.loadNpmTasks('grunt-contrib-cssmin');
113+
grunt.loadNpmTasks('grunt-contrib-uglify');
114+
grunt.loadNpmTasks('grunt-contrib-watch');
115+
116+
// Register tasks.
117+
grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core',
118+
'uglify:core', 'uglify:tinymce']);
119+
120+
121+
// Add a temporary setup task for preparing the directory using existing repositories.
122+
grunt.registerTask('setup', ['clean:all', 'svn']);
123+
124+
// Add an svn task for checking out repositories.
125+
grunt.registerMultiTask('svn', 'Check out a Subversion repository.', function() {
126+
var done = this.async();
127+
var args = ['checkout', '--ignore-externals', this.data.repository];
128+
if (this.data.dest) {
129+
args.push(this.data.dest);
130+
}
131+
132+
grunt.util.spawn({
133+
cmd: 'svn',
134+
args: args,
135+
opts: {stdio: 'inherit'}
136+
}, done);
137+
});
138+
139+
// Default task.
140+
grunt.registerTask('default', ['build']);
141+
142+
// Add a listener to the watch task.
143+
//
144+
// On `watch:all`, automatically updates the `copy:dynamic` and `clean:dynamic`
145+
// configurations so that only the changed files are updated.
146+
grunt.event.on('watch', function(action, filepath, target) {
147+
if (target != 'all') return;
148+
149+
var relativePath = path.relative(SOURCE_DIR, filepath);
150+
var cleanSrc = (action == 'deleted') ? [relativePath] : [];
151+
var copySrc = (action == 'deleted') ? [] : [relativePath];
152+
grunt.config(['clean', 'dynamic', 'src'], cleanSrc);
153+
grunt.config(['copy', 'dynamic', 'src'], copySrc);
154+
});
155+
};

package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "WordPress",
3+
"version": "3.7.0",
4+
"description": "WordPress is web software you can use to create a beautiful website or blog.",
5+
"repository": {
6+
"type": "svn",
7+
"url": "https://develop.svn.wordpress.org/trunk"
8+
},
9+
"author": "The WordPress Contributors",
10+
"license": "GPLv2 or later",
11+
"devDependencies": {
12+
"grunt": "~0.4.1",
13+
"grunt-contrib-clean": "~0.5.0",
14+
"grunt-contrib-copy": "~0.4.1",
15+
"grunt-contrib-cssmin": "~0.6.1",
16+
"grunt-contrib-uglify": "~0.2.2",
17+
"grunt-contrib-watch": "~0.5.1"
18+
}
19+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)