diff --git a/UPDATE.md b/UPDATE.md index 61fa2fcb0..3ed1179c4 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -170,6 +170,9 @@ are currently running 2.2.0 and are trying to update to 2.2.6, you will need to follow the instructions for updating from 2.2.0 to 2.2.1, then from 2.2.1 to 2.2.2, in that order. +## 3.3.4 to 3.4.0 +There are no manual update steps for this version. + ## 3.3.3 to 3.3.4 There are no manual update steps for this version. diff --git a/composer.json b/composer.json index a5d23fd2b..faa1ad635 100644 --- a/composer.json +++ b/composer.json @@ -95,6 +95,7 @@ "ln -s -f git-hooks/pre-commit .git/hooks/pre-commit", "@composer package" ], + "configure-tarball": "Acquia\\Lightning\\Composer\\ConfigureLegacyProject::execute", "drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold", "enable-asset-packagist": "Acquia\\Lightning\\Composer\\AssetPackagist::execute", "nuke": "rm -r -f docroot vendor", diff --git a/composer.lock b/composer.lock index 9125f1100..707f674c1 100644 --- a/composer.lock +++ b/composer.lock @@ -6164,16 +6164,16 @@ }, { "name": "pear/pear_exception", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/pear/PEAR_Exception.git", - "reference": "8c18719fdae000b690e3912be401c76e406dd13b" + "reference": "dbb42a5a0e45f3adcf99babfb2a1ba77b8ac36a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/8c18719fdae000b690e3912be401c76e406dd13b", - "reference": "8c18719fdae000b690e3912be401c76e406dd13b", + "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/dbb42a5a0e45f3adcf99babfb2a1ba77b8ac36a7", + "reference": "dbb42a5a0e45f3adcf99babfb2a1ba77b8ac36a7", "shasum": "" }, "require": { @@ -6189,9 +6189,9 @@ } }, "autoload": { - "psr-0": { - "PEAR": "" - } + "classmap": [ + "PEAR/" + ] }, "notification-url": "https://packagist.org/downloads/", "include-path": [ @@ -6215,7 +6215,7 @@ "keywords": [ "exception" ], - "time": "2015-02-10T20:07:52+00:00" + "time": "2019-12-10T10:24:42+00:00" }, { "name": "phpdocumentor/reflection-common", diff --git a/src/Composer/ConfigureLegacyProject.php b/src/Composer/ConfigureLegacyProject.php new file mode 100644 index 000000000..4deaeca8f --- /dev/null +++ b/src/Composer/ConfigureLegacyProject.php @@ -0,0 +1,51 @@ +getArguments(); + + $target = new JsonFile($arguments[0] . '/composer.json'); + $project = $target->read(); + + $required = $event->getComposer()->getPackage()->getRequires(); + $components = [ + 'api', + 'core', + 'media', + 'layout', + 'workflow', + ]; + foreach ($components as $component) { + $project['require']["drupal/lightning_$component"] = $required["drupal/lightning_$component"]->getPrettyConstraint(); + } + $project['repositories'][] = [ + 'type' => 'composer', + 'url' => 'https://asset-packagist.org', + ]; + $project['extra']['installer-paths']['libraries/{$name}'] = [ + 'type:drupal-library', + 'type:bower-asset', + 'type:npm-asset', + ]; + $project['extra']['installer-types'] = ['bower-asset', 'npm-asset']; + $project['extra']['patchLevel']['drupal/core'] = '-p2'; + + $target->write($project); + } + +} diff --git a/tarball.sh b/tarball.sh index e4b0134ac..bf3d30549 100755 --- a/tarball.sh +++ b/tarball.sh @@ -1,7 +1,5 @@ #!/bin/bash -DESTINATION=`pwd` -WORK_DIR=/tmp ARCHIVE=lightning-8.x-$1 PROFILE_DIR=profiles/contrib/lightning YAML_CLI=`command -v yaml-cli` @@ -13,31 +11,26 @@ if [[ ! $YAML_CLI ]]; then exit 1 fi -# Generate the Drush make file we will use to build the tarball. -composer package 1> $WORK_DIR/cloud.make +composer create-project --stability beta --no-install drupal/legacy-project:~8.8.0 $ARCHIVE +composer dump-autoload +composer configure-tarball $ARCHIVE # Update version number in info files. find . -name "*.info.yml" -exec $YAML_CLI update:value {} version 8.x-$1 \; # Create an archive of the profile to be added to the tarball. -composer archive --file $ARCHIVE --dir $WORK_DIR +composer archive --file $ARCHIVE # Remove modifications to info files. git reset --hard -# Switch to a scratch directory. -cd $WORK_DIR - -# Download Drush 8, which has the make command, and make it executable. -curl -L -o drush https://github.com/drush-ops/drush/releases/download/8.1.16/drush.phar -chmod +x drush - -# Build the code base from the generated make file. -./drush make cloud.make $ARCHIVE - -# Add required Composer dependencies. cd $ARCHIVE -composer require j7mbo/twitter-api-php league/oauth2-server:~6.0 webflo/drupal-core-strict:~8.7.0 'phpdocumentor/reflection-docblock:^3.0||^4.0' +composer config extra.enable-patching true +composer config minimum-stability dev +composer config prefer-stable true +composer remove --no-update composer/installers +composer require --no-update "ext-dom:*" cweagans/composer-patches oomphinc/composer-installers-extender +composer update # Create the profile destination directory. mkdir -p $PROFILE_DIR @@ -47,7 +40,7 @@ tar -x -f ../$ARCHIVE.tar --directory $PROFILE_DIR cd .. # Wrap it all up in a nice compressed tarball. -tar --exclude='.DS_Store' --exclude='._*' -c -z -f $DESTINATION/$ARCHIVE.tar.gz $ARCHIVE +tar --exclude='.DS_Store' --exclude='._*' -c -z -f $ARCHIVE.tar.gz $ARCHIVE # Clean up. -rm -r -f drush $ARCHIVE.tar $ARCHIVE cloud.make +rm -r -f $ARCHIVE.tar $ARCHIVE diff --git a/tests/fixtures/3.3.4.php.gz b/tests/fixtures/3.3.4.php.gz index 1b66adfd8..000d533c7 100644 Binary files a/tests/fixtures/3.3.4.php.gz and b/tests/fixtures/3.3.4.php.gz differ diff --git a/tests/fixtures/3.4.0.php.gz b/tests/fixtures/3.4.0.php.gz new file mode 100644 index 000000000..345558fe7 Binary files /dev/null and b/tests/fixtures/3.4.0.php.gz differ