Skip to content

Commit f9ed694

Browse files
Remove "version" from composer.json files, use "branch-version" instead
1 parent 27c2260 commit f9ed694

File tree

56 files changed

+170
-66
lines changed

Some content is hidden

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

56 files changed

+170
-66
lines changed

.appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ install:
5353
- IF NOT EXIST composer.phar (appveyor DownloadFile https://github.com/composer/composer/releases/download/1.9.0/composer.phar)
5454
- php composer.phar self-update
5555
- copy /Y .github\composer-config.json %APPDATA%\Composer\config.json
56-
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
56+
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex
5757
- git config --global user.email ""
5858
- git config --global user.name "Symfony"
5959
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit
60+
- SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev
6061
- php composer.phar config platform.php 5.5.9
6162
- php composer.phar update --no-progress --no-suggest --ansi
6263
- php phpunit install

.github/build-packages.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@
5050
passthru("cd $dir && git init && git add . && git commit -q -m - && git archive -o package.tar HEAD && rm .git/ -Rf");
5151
}
5252

53-
if (!isset($package->version)) {
54-
echo "Missing \"version\" in composer.json.\n";
53+
if (!isset($package->extra->{'branch-version'})) {
54+
echo "Missing \"branch-version\" in composer.json's \"extra\".\n";
5555
exit(1);
5656
}
57+
$package->version = substr_replace($package->extra->{'branch-version'}, '.x-dev', -4);
5758
$package->dist['type'] = 'tar';
5859
$package->dist['url'] = 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__))."/$dir/package.tar";
5960

@@ -62,8 +63,6 @@
6263
$versions = @file_get_contents('https://repo.packagist.org/p/'.$package->name.'.json') ?: sprintf('{"packages":{"%s":{"%s":%s}}}', $package->name, $package->version, file_get_contents($dir.'/composer.json'));
6364
$versions = json_decode($versions)->packages->{$package->name};
6465

65-
unset($versions->{'dev-master'});
66-
6766
foreach ($versions as $v => $package) {
6867
$packages[$package->name] += array($v => $package);
6968
}

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ install:
228228
git fetch --depth=2 origin refs/pull/$SYMFONY_PHPUNIT_BRIDGE_PR/head
229229
git rm -rq src/Symfony/Bridge/PhpUnit
230230
git checkout -q FETCH_HEAD -- src/Symfony/Bridge/PhpUnit
231-
export SYMFONY_VERSION=$(cat src/Symfony/Bridge/PhpUnit/composer.json | grep '^ *"version": *"[1-9]' | grep -o '[0-9.]*[0-9]')
231+
export SYMFONY_VERSION=$(cat src/Symfony/Bridge/PhpUnit/composer.json | grep '^ *"branch-version": *"[1-9]' | grep -o '[0-9.]*')
232232
sed -i 's/"symfony\/phpunit-bridge": ".*"/"symfony\/phpunit-bridge": "'$SYMFONY_VERSION'.x@dev"/' composer.json
233233
rm -rf .phpunit
234234
fi
@@ -254,19 +254,19 @@ install:
254254
fi
255255
256256
- |
257-
# For the .x branch, when deps=high, the version before .x is checked out and tested with the locally patched components
257+
# For the feature-branch, when deps=high, the version before it is checked out and tested with the locally patched components
258258
if [[ $deps = high && $TRAVIS_BRANCH = *.x ]]; then
259259
export FLIP='🙃'
260260
export SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//) &&
261261
git fetch --depth=2 origin $SYMFONY_VERSION &&
262262
git checkout -m FETCH_HEAD &&
263263
export COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
264264
else
265-
export SYMFONY_VERSION=$(cat composer.json | grep '^ *"version". *"[1-9]' | grep -o '[0-9.]*[0-9]')
265+
export SYMFONY_VERSION=$(cat composer.json | grep '^ *"branch-version": *"[1-9]' | grep -o '[0-9.]*')
266266
fi
267267
268268
- |
269-
# Skip the phpunit-bridge on bugfix-only branches when $deps is empty
269+
# Skip the phpunit-bridge on bugfix-branches when $deps is empty
270270
if [[ ! $deps && ! $TRAVIS_BRANCH = *.x ]]; then
271271
export COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -not -wholename '*/Bridge/PhpUnit/*' -printf '%h\n' | sort)
272272
fi
@@ -285,11 +285,11 @@ install:
285285
else
286286
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
287287
fi
288-
composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
288+
composer global require --no-progress --no-scripts --no-plugins symfony/flex
289289
290290
- |
291291
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
292-
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"version". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy
292+
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"branch-version": *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy
293293
294294
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
295295
if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi
@@ -312,7 +312,7 @@ install:
312312
fi
313313
tfold 'composer update' $COMPOSER_UP
314314
if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then
315-
tfold 'phpunit install' 'composer global remove symfony/flex && ./phpunit install && composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master'
315+
tfold 'phpunit install' 'composer global remove symfony/flex && ./phpunit install && composer global require --no-progress --no-scripts --no-plugins symfony/flex'
316316
else
317317
tfold 'phpunit install' ./phpunit install
318318
fi

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,7 @@
134134
"files": [ "src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
135135
},
136136
"minimum-stability": "dev",
137-
"version": "3.4.x-dev"
137+
"extra": {
138+
"branch-version": "3.4-dev"
139+
}
138140
}

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,7 @@
5757
]
5858
},
5959
"minimum-stability": "dev",
60-
"version": "3.4.x-dev"
60+
"extra": {
61+
"branch-version": "3.4-dev"
62+
}
6163
}

src/Symfony/Bridge/Monolog/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@
4343
]
4444
},
4545
"minimum-stability": "dev",
46-
"version": "3.4.x-dev"
46+
"extra": {
47+
"branch-version": "3.4-dev"
48+
}
4749
}

src/Symfony/Bridge/PhpUnit/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
],
3939
"minimum-stability": "dev",
4040
"extra": {
41+
"branch-version": "3.4-dev",
4142
"thanks": {
4243
"name": "phpunit/phpunit",
4344
"url": "https://github.com/sebastianbergmann/phpunit"
4445
}
45-
},
46-
"version": "3.4.x-dev"
46+
}
4747
}

src/Symfony/Bridge/ProxyManager/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@
3030
]
3131
},
3232
"minimum-stability": "dev",
33-
"version": "3.4.x-dev"
33+
"extra": {
34+
"branch-version": "3.4-dev"
35+
}
3436
}

src/Symfony/Bridge/Twig/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,7 @@
6767
]
6868
},
6969
"minimum-stability": "dev",
70-
"version": "3.4.x-dev"
70+
"extra": {
71+
"branch-version": "3.4-dev"
72+
}
7173
}

src/Symfony/Bundle/DebugBundle/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@
4141
]
4242
},
4343
"minimum-stability": "dev",
44-
"version": "3.4.x-dev"
44+
"extra": {
45+
"branch-version": "3.4-dev"
46+
}
4547
}

0 commit comments

Comments
 (0)