diff --git a/src/Kunstmaan/GeneratorBundle/Command/GenerateLayoutCommand.php b/src/Kunstmaan/GeneratorBundle/Command/GenerateLayoutCommand.php index 27b9aad1c4..552fc48e4d 100644 --- a/src/Kunstmaan/GeneratorBundle/Command/GenerateLayoutCommand.php +++ b/src/Kunstmaan/GeneratorBundle/Command/GenerateLayoutCommand.php @@ -100,7 +100,7 @@ protected function createGenerator() $filesystem = $this->getContainer()->get('filesystem'); $registry = $this->getContainer()->get('doctrine'); - return new LayoutGenerator($filesystem, $registry, '/layout', $this->assistant); + return new LayoutGenerator($filesystem, $registry, '/layout', $this->assistant, $this->getContainer()); } /** diff --git a/src/Kunstmaan/GeneratorBundle/Generator/LayoutGenerator.php b/src/Kunstmaan/GeneratorBundle/Generator/LayoutGenerator.php index 29f15dac90..6fbff5dcb7 100644 --- a/src/Kunstmaan/GeneratorBundle/Generator/LayoutGenerator.php +++ b/src/Kunstmaan/GeneratorBundle/Generator/LayoutGenerator.php @@ -62,7 +62,7 @@ private function generateGroundcontrolFiles() $this->renderFiles( $this->skeletonDir . '/groundcontrol/bin/', $this->rootDir . '/groundcontrol/', - array('bundle' => $this->bundle, 'demosite' => $this->demosite, 'browserSyncUrl' => $this->browserSyncUrl), + array('bundle' => $this->bundle, 'demosite' => $this->demosite, 'browserSyncUrl' => $this->browserSyncUrl, 'isV4' => $this->isSymfony4()), true ); $this->renderSingleFile( @@ -104,7 +104,7 @@ private function generateGroundcontrolFiles() $this->skeletonDir . '/groundcontrol/', $this->rootDir, 'gulpfile.babel.js', - array('bundle' => $this->bundle, 'demosite' => $this->demosite), + array('bundle' => $this->bundle, 'demosite' => $this->demosite, 'isV4' => $this->isSymfony4()), true ); $this->renderSingleFile( @@ -123,90 +123,89 @@ private function generateGroundcontrolFiles() private function generateAssets() { $sourceDir = $this->skeletonDir; - $targetDir = $this->bundle->getPath(); $relPath = '/Resources/ui/'; - $this->copyFiles($sourceDir . $relPath, $targetDir . $relPath, true); + $this->copyFiles($sourceDir . $relPath, $this->getAssetsDir($this->bundle) . '/ui', true); $this->renderFiles( $sourceDir . $relPath . '/js/', - $targetDir . $relPath . '/js/', + $this->getAssetsDir($this->bundle) . '/ui/js/', array('bundle' => $this->bundle, 'demosite' => $this->demosite), true ); $this->renderFiles( $sourceDir . $relPath . '/scss/', - $targetDir . $relPath . '/scss/', + $this->getAssetsDir($this->bundle) . '/ui/scss/', array('bundle' => $this->bundle, 'demosite' => $this->demosite), true ); if (!$this->demosite) { // Files - $this->removeDirectory($targetDir . $relPath . '/files/'); + $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/files/'); // Images - $this->removeDirectory($targetDir . $relPath . '/fonts/'); + $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/fonts/'); // JS - $this->removeFile($targetDir . $relPath . '/js/search.js'); - $this->removeFile($targetDir . $relPath . '/js/demoMsg.js'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/js/search.js'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/js/demoMsg.js'); // Images - $this->removeDirectory($targetDir . $relPath . '/img/demosite/'); - $this->removeDirectory($targetDir . $relPath . '/img/buttons/'); - $this->removeDirectory($targetDir . $relPath . '/img/dummy/'); - $this->removeDirectory($targetDir . $relPath . '/img/backgrounds/'); + $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/img/demosite/'); + $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/img/buttons/'); + $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/img/dummy/'); + $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/img/backgrounds/'); // SCSS // SCSS - Blocks - $this->removeFile($targetDir . $relPath . '/scss/components/blocks/_img-icon.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/blocks/_img-icon.scss'); // SCSS - Forms - $this->removeFile($targetDir . $relPath . '/scss/components/forms/_form-widget.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/forms/_form-widget.scss'); // SCSS - Structures - $this->removeFile($targetDir . $relPath . '/scss/components/structures/_splash.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/docs/splash.md'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/_submenu.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/docs/submenu.md'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/_blog-item.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/docs/blog-item.md'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/docs/blog-item-summary.md'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/_search-results.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/docs/search-results.md'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/_breadcrumb-nav.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/docs/breadcrumb.md'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/_header-visual.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/docs/header-visual.md'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/_newsletter.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/docs/newsletter.md'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/_pagination.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/docs/pagination.md'); - $this->removeFile($targetDir . $relPath . '/scss/components/structures/_demosite-msg.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_splash.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/splash.md'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_submenu.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/submenu.md'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_blog-item.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/blog-item.md'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/blog-item-summary.md'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_search-results.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/search-results.md'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_breadcrumb-nav.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/breadcrumb.md'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_header-visual.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/header-visual.md'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_newsletter.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/newsletter.md'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_pagination.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/pagination.md'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_demosite-msg.scss'); // SCSS - Header - $this->removeFile($targetDir . $relPath . '/scss/components/header/_main-nav.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/header/_site-nav.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/header/_language-nav.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/header/_contact-nav.scss'); - $this->removeFile($targetDir . $relPath . '/scss/components/header/_search-form.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_main-nav.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_site-nav.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_language-nav.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_contact-nav.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_search-form.scss'); // SCSS - Footer - $this->removeFile($targetDir . $relPath . '/scss/components/footer/_social-footer.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/footer/_social-footer.scss'); // SCSS - Pageparts - $this->removeFile($targetDir . $relPath . '/scss/components/pageparts/_service-pp.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/pageparts/_service-pp.scss'); // SCSS - Config - $this->removeFile($targetDir . $relPath . '/scss/config/vendors/_cargobay-imports.scss'); - $this->removeFile($targetDir . $relPath . '/scss/config/vendors/_cargobay-vars.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/config/vendors/_cargobay-imports.scss'); + $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/config/vendors/_cargobay-vars.scss'); // SCSS - Mixins - $this->removeDirectory($targetDir . $relPath . '/scss/helpers/mixins/'); + $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/scss/helpers/mixins/'); } $relPath = '/Resources/admin/'; - $this->copyFiles($sourceDir . $relPath, $targetDir . $relPath, true); + $this->copyFiles($sourceDir . $relPath, $this->getAssetsDir($this->bundle) . '/admin', true); $this->assistant->writeLine('Generating ui assets : OK'); } @@ -216,20 +215,18 @@ private function generateAssets() */ private function generateTemplate() { - $targetDir = $this->bundle->getPath(); - $relPath = '/Resources/views/'; $this->renderFiles( $this->skeletonDir . $relPath, - $this->bundle->getPath() . $relPath, - array('bundle' => $this->bundle, 'demosite' => $this->demosite, 'shortBundleName' => $this->shortBundleName), + $this->getTemplateDir($this->bundle), + array('bundle' => $this->bundle, 'demosite' => $this->demosite, 'shortBundleName' => $this->shortBundleName, 'isV4' => $this->isSymfony4()), true ); if (!$this->demosite) { // Layout - $this->removeFile($targetDir . $relPath . '/Layout/_mobile-nav.html.twig'); - $this->removeFile($targetDir . $relPath . '/Layout/_demositemessage.html.twig'); + $this->removeFile($this->getTemplateDir($this->bundle) . '/Layout/_mobile-nav.html.twig'); + $this->removeFile($this->getTemplateDir($this->bundle) . '/Layout/_demositemessage.html.twig'); } $this->assistant->writeLine('Generating template files : OK'); diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Default/index.html.twig b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Default/index.html.twig index c7fcd94eec..bb1d7cca90 100644 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Default/index.html.twig +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Default/index.html.twig @@ -1,4 +1,4 @@ -{% extends '<%= shortBundleName %>/Page/layout.html.twig' %} +{% extends '<% if not isV4 %><%= shortBundleName %>/<% endif %>Page/layout.html.twig' %} {% block content %} It works! diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Error/layout.html.twig b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Error/layout.html.twig index d95c4ef3c1..589580c74a 100755 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Error/layout.html.twig +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Error/layout.html.twig @@ -12,22 +12,22 @@ {# Favicons #} - {% include '<%= bundle.getName() %>:Layout:_favicons.html.twig' %} + {% include '<% if not isV4 %><%= bundle.getName() %>:<% endif %>Layout/_favicons.html.twig' %} {# Webfonts #} - {% include '<%= bundle.getName() %>:Layout:_webfonts.html.twig' %} + {% include '<% if not isV4 %><%= bundle.getName() %>:<% endif %>Layout/_webfonts.html.twig' %} {# CSS #} - {% include '<%= bundle.getName() %>:Layout:_css.html.twig' %} + {% include '<% if not isV4 %><%= bundle.getName() %>:<% endif %>Layout/_css.html.twig' %} {# Google Tagmanager #} - {% include '<%= bundle.getName() %>:Layout:_googletagmanager.html.twig' %} + {% include '<% if not isV4 %><%= bundle.getName() %>:<% endif %>Layout/_googletagmanager.html.twig' %} {# Outdated browser message #} - {% include '<%= bundle.getName() %>:Layout:_outdatedbrowser.html.twig' %} + {% include '<% if not isV4 %><%= bundle.getName() %>:<% endif %>Layout/_outdatedbrowser.html.twig' %} {# Content #}
diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Layout/_header.html.twig b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Layout/_header.html.twig index 2f6adeb8ab..48b242cc21 100644 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Layout/_header.html.twig +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Layout/_header.html.twig @@ -43,7 +43,7 @@ {# Desktop header #} {# DemositeMessage #} {% block cookieconsent %} - {% include '<%= shortBundleName %>/Layout/_demositemessage.html.twig' %} + {% include '<% if not isV4 %><%= shortBundleName %>/<% endif %>Layout/_demositemessage.html.twig' %} {% endblock %} {% if nodemenu is defined %} diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Layout/layout.html.twig b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Layout/layout.html.twig index fa843b2a2a..9b73d898f6 100755 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Layout/layout.html.twig +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Layout/layout.html.twig @@ -31,13 +31,13 @@ {% endif %} {# Favicons #} - {% include '<%= shortBundleName %>/Layout/_favicons.html.twig' %} + {% include '<% if not isV4 %><%= shortBundleName %>/<% endif %>Layout/_favicons.html.twig' %} {# Webfonts #} - {% include '<%= bundle.getName() %>:Layout:_webfonts.html.twig' %} + {% include '<% if not isV4 %><%= shortBundleName %>/<% endif %>Layout/_webfonts.html.twig' %} {# CSS #} - {% include '<%= shortBundleName %>/Layout/_css.html.twig' %} + {% include '<% if not isV4 %><%= shortBundleName %>/<% endif %>Layout/_css.html.twig' %} {% endspaceless %} @@ -46,15 +46,15 @@
<% endif %> {# Google Tagmanager #} - {% include '<%= shortBundleName %>/Layout/_googletagmanager.html.twig' %} + {% include '<% if not isV4 %><%= shortBundleName %>/<% endif %>Layout/_googletagmanager.html.twig' %} {# Outdated browser message #} - {% include '<%= shortBundleName %>/Layout/_outdatedbrowser.html.twig' %} + {% include '<% if not isV4 %><%= shortBundleName %>/<% endif %>Layout/_outdatedbrowser.html.twig' %} <% if demosite %> diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Page/layout.html.twig b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Page/layout.html.twig index b33bdf523e..70615a5ad9 100755 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Page/layout.html.twig +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/Resources/views/Page/layout.html.twig @@ -1 +1 @@ -{% extends '<%= shortBundleName %>/Layout/layout.html.twig' %} +{% extends '<% if not isV4 %><%= shortBundleName %>/<% endif %>Layout/layout.html.twig' %} diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.admin-extra.js b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.admin-extra.js index 829466d9a3..27483c09d8 100644 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.admin-extra.js +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.admin-extra.js @@ -3,9 +3,9 @@ import defaultConfig from './webpack.config.default'; export default function webpackConfigAdminExtra(speedupLocalDevelopment, optimize = false) { const config = defaultConfig(speedupLocalDevelopment, optimize); - config.entry = './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/admin/js/admin-bundle-extra.js'; + config.entry = './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/admin/js/admin-bundle-extra.js'; config.output = { - filename: './web/frontend/js/admin-bundle-extra.js', + filename: './{% if isV4 %}public{% else %}web{% endif %}/frontend/js/admin-bundle-extra.js', }; return config; diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.app.js b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.app.js index 3c71b08c4d..b86b17a6de 100644 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.app.js +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.app.js @@ -6,9 +6,9 @@ import defaultConfig from './webpack.config.default'; export default function webpackConfigApp(speedupLocalDevelopment, optimize = false) { const config = defaultConfig(speedupLocalDevelopment, optimize); - config.entry = './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/js/app.js'; + config.entry = './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/js/app.js'; config.output = { - path: path.resolve(__dirname, '../../web/frontend/js'), + path: path.resolve(__dirname, '../../{% if isV4 %}public{% else %}web{% endif %}/frontend/js'), filename: 'bundle.js', }; {% if demosite %} diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.styleguide.js b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.styleguide.js index 45a97c745f..1d4bbfc757 100644 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.styleguide.js +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/config/webpack.config.styleguide.js @@ -4,9 +4,9 @@ import defaultConfig from './webpack.config.default'; export default function webpackConfigStyleguide(speedupLocalDevelopment, optimize = false) { const config = defaultConfig(speedupLocalDevelopment, optimize); - config.entry = './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/styleguide/js/styleguide.js'; + config.entry = './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/styleguide/js/styleguide.js'; config.output = { - path: path.resolve(__dirname, '../../web/frontend/styleguide/js'), + path: path.resolve(__dirname, '../../{% if isV4 %}public{% else %}web{% endif %}/frontend/styleguide/js'), filename: 'styleguide.js', }; diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/configured-tasks.js b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/configured-tasks.js index 2cecf9b79d..670d88a43e 100755 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/configured-tasks.js +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/bin/configured-tasks.js @@ -16,38 +16,38 @@ import webpackConfigAdminExtra from './config/webpack.config.admin-extra'; import webpackConfigStyleguide from './config/webpack.config.styleguide'; export const images = createImagesTask({ - src: './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/img/**', - dest: './web/frontend/img' + src: './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/img/**', + dest: './{% if isV4 %}public{% else %}web{% endif %}/frontend/img' }); export const eslint = createEslintTask({ - src: './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/js/**/*.js', + src: './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/js/**/*.js', failAfterError: !consoleArguments.continueAfterTestError, }); export const stylelint = createStylelintTask({ - src: './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/scss/**/*.scss', + src: './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/scss/**/*.scss', }); export const clean = createCleanTask({ - target: ['./web/frontend'], + target: ['./{% if isV4 %}public{% else %}web{% endif %}/frontend'], }); export const copy = gulp.parallel( {% if demosite %} - createCopyTask({src: ['./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/files/**'], dest: './web/frontend/files'}), + createCopyTask({src: ['./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/files/**'], dest: './{% if isV4 %}public{% else %}web{% endif %}/frontend/files'}), {% endif %} - createCopyTask({src: ['./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/fonts/**'], dest: './web/frontend/fonts'}) + createCopyTask({src: ['./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/fonts/**'], dest: './{% if isV4 %}public{% else %}web{% endif %}/frontend/fonts'}) ); export const cssLocal = createCssLocalTask({ - src: './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/scss/style.scss', - dest: './web/frontend/css', + src: './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/scss/style.scss', + dest: './{% if isV4 %}public{% else %}web{% endif %}/frontend/css', }); export const cssOptimized = createCssOptimizedTask({ - src: './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/scss/*.scss', - dest: './web/frontend/css', + src: './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/scss/*.scss', + dest: './{% if isV4 %}public{% else %}web{% endif %}/frontend/css', }); export const bundleLocal = createBundleTask({ @@ -72,10 +72,10 @@ export const server = createServerTask({ ui: false, ghostMode: false, files: [ - 'web/frontend/css/*.css', - 'web/frontend/js/*.js', - 'web/frontend/img/**/*', - 'web/frontend/styleguide/*.html', + '{% if isV4 %}public{% else %}web{% endif %}/frontend/css/*.css', + '{% if isV4 %}public{% else %}web{% endif %}/frontend/js/*.js', + '{% if isV4 %}public{% else %}web{% endif %}/frontend/img/**/*', + '{% if isV4 %}public{% else %}web{% endif %}/frontend/styleguide/*.html', ], open: false, reloadOnRestart: true, @@ -93,10 +93,10 @@ export const server = createServerTask({ }); export const generateStyleguide = createStyleguideTask({ - src: './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/scss/**/*.scss', - dest: './web/frontend/styleguide', - template: './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/styleguide/templates/layout.hbs', - partials: './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/styleguide/templates/partials/*.hbs', + src: './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/scss/**/*.scss', + dest: './{% if isV4 %}public{% else %}web{% endif %}/frontend/styleguide', + template: './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/styleguide/templates/layout.hbs', + partials: './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/styleguide/templates/partials/*.hbs', sortOrder: [ { Index: [ @@ -111,12 +111,12 @@ export const generateStyleguide = createStyleguideTask({ export const copyStyleguide = createCopyTask({ src: ['./node_modules/prismjs/themes/prism-okaidia.css'], - dest: './web/frontend/styleguide/css', + dest: './{% if isV4 %}public{% else %}web{% endif %}/frontend/styleguide/css', }); export const cssStyleguideOptimized = createCssOptimizedTask({ - src: './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/styleguide/scss/*.scss', - dest: './web/frontend/styleguide/css', + src: './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/styleguide/scss/*.scss', + dest: './{% if isV4 %}public{% else %}web{% endif %}/frontend/styleguide/css', }); export const bundleStyleguideOptimized = createBundleTask({ @@ -124,21 +124,21 @@ export const bundleStyleguideOptimized = createBundleTask({ }); export function buildOnChange(done) { - gulp.watch('./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/js/**/!(*.spec).js', bundleLocal); - gulp.watch('./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/admin/js/**/!(*.spec).js', bundleAdminExtraLocal); - gulp.watch('./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/scss/**/*.scss', cssLocal); - gulp.watch('./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/img/**', images); + gulp.watch('./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/js/**/!(*.spec).js', bundleLocal); + gulp.watch('./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/admin/js/**/!(*.spec).js', bundleAdminExtraLocal); + gulp.watch('./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/scss/**/*.scss', cssLocal); + gulp.watch('./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/img/**', images); done(); } export function testOnChange(done) { - gulp.watch('./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/js/**/*.js', eslint); - gulp.watch('./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/scss/**/*.scss', stylelint); - gulp.watch('./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/scss/**/*.scss', cssLocal); + gulp.watch('./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/js/**/*.js', eslint); + gulp.watch('./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/scss/**/*.scss', stylelint); + gulp.watch('./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/scss/**/*.scss', cssLocal); gulp.watch([ - './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/scss/**/*.md', - './src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/styleguide/**/*.hbs', + './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/scss/**/*.md', + './{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/styleguide/**/*.hbs', ], generateStyleguide); - gulp.watch('./src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources/ui/styleguide/scss/**/*.scss', cssStyleguideOptimized); + gulp.watch('./{% if isV4 %}assets{% else %}src/{{ bundle.namespace|replace({'\\':'/'}) }}/Resources{% endif %}/ui/styleguide/scss/**/*.scss', cssStyleguideOptimized); done(); } diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/gulpfile.babel.js b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/gulpfile.babel.js index 9b4f2950b7..89d00e9d79 100755 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/gulpfile.babel.js +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/layout/groundcontrol/gulpfile.babel.js @@ -79,7 +79,7 @@ const buildCmsAssets = gulp.series(() => gulp.src('vendor/kunstmaan/bundles-cms/ .pipe(chug({ args: [ '--rootPath', - '../../../../../../../web/assets/', + '../../../../../../../{% if isV4 %}public{% else %}web{% endif %}/assets/', ], tasks: ['buildOptimized'], })));