Skip to content

Commit

Permalink
[0.62] Provide information to metro to redirect to rn-macos when buil…
Browse files Browse the repository at this point in the history
…ding macos (#596)

* Provide information to metro to redirect to rn-macos when building macos (#587)

* Provide information to metro to redirect to rn-macos when building macos

* Update version of cli we are using

* more config

Co-authored-by: Andrew Coates <acoates-ms@noreply.github.com>

* Enable PR builds on 0.62 branch

* Fix CI

* fix ci take 2

* take3

Co-authored-by: Andrew Coates <acoates-ms@noreply.github.com>
  • Loading branch information
acoates-ms and Andrew Coates authored Sep 15, 2020
1 parent 113efa7 commit f59ede3
Show file tree
Hide file tree
Showing 6 changed files with 232 additions and 90 deletions.
1 change: 1 addition & 0 deletions .ado/android-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pr:
include:
- master
- 0.59-stable
- 0.62-stable
paths:
exclude:
- '*.md'
Expand Down
1 change: 1 addition & 0 deletions .ado/apple-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pr:
include:
- master
- 0.59-stable
- 0.62-stable
paths:
exclude:
- '*.md'
Expand Down
2 changes: 1 addition & 1 deletion .ado/templates/react-native-macos-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ steps:
- task: CmdLine@2
displayName: Bump package version
inputs:
script: node scripts/bump-oss-version.js --nightly
script: node scripts/bump-oss-version.js --ci 0.62.1000

- script: |
npm publish --registry http://localhost:4873
Expand Down
36 changes: 36 additions & 0 deletions react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,42 @@ module.exports = {
projectConfig: android.projectConfig,
dependencyConfig: android.dependencyConfig,
},
macos: {
linkConfig: () => {
return {
isInstalled: (
_projectConfig /*ProjectConfig*/,
_package /*string*/,
_dependencyConfig /*DependencyConfig*/,
) => false /*boolean*/,
register: (
_package /*string*/,
_dependencyConfig /*DependencyConfig*/,
_obj /*Object*/,
_projectConfig /*ProjectConfig*/,
) => {},
unregister: (
_package /*string*/,
_dependencyConfig /*DependencyConfig*/,
_projectConfig /*ProjectConfig*/,
_dependencyConfigs /*Array<DependencyConfig>*/,
) => {},
copyAssets: (
_assets /*string[]*/,
_projectConfig /*ProjectConfig*/,
) => {},
unlinkAssets: (
_assets /*string[]*/,
_projectConfig /*ProjectConfig*/,
) => {},
};
},
projectConfig: () => null,
dependencyConfig: () => null,
npmPackageName: isReactNativeMacOS
? 'react-native-macos'
: 'react-native',
},
},
/**
* Used when running RNTester (with React Native from source)
Expand Down
7 changes: 6 additions & 1 deletion scripts/bump-oss-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ let argv = yargs.option('r', {
alias: 'remote',
default: 'origin',
})
.option('ci', {
type: 'boolean',
default: false,
})
.option('n', {
alias: 'nightly',
type: 'boolean',
default: false,
}).argv;

const nightlyBuild = argv.nightly;
const ci = argv.ci;

let version, branch;
if (nightlyBuild) {
Expand All @@ -42,7 +47,7 @@ if (nightlyBuild) {
silent: true,
}).stdout.trim();

if (branch.indexOf('-stable') === -1) {
if (!ci && branch.indexOf('-stable') === -1) {
echo('You must be in 0.XX-stable branch to bump a version');
exit(1);
}
Expand Down
Loading

0 comments on commit f59ede3

Please sign in to comment.