Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…native into windows-native-expander
  • Loading branch information
amdingler committed Jul 19, 2021
2 parents 3ab3f18 + 580752e commit 7721dee
Show file tree
Hide file tree
Showing 243 changed files with 7,081 additions and 2,143 deletions.
40 changes: 40 additions & 0 deletions .ado/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,43 @@ jobs:
publishJUnitResults: false
javaHomeOption: 'JDKVersion'
sonarQubeRunAnalysis: false

- job: NuGetPublishDryRun
displayName: NuGet Publish Dry Run
pool:
vmImage: 'macos-10.15'
demands: ['xcode', 'sh', 'npm']
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them

steps:
- checkout: self
persistCredentials: true

- template: templates/setup-repo-min-build.yml

# Clean Derived Data
- script: |
rm -rf $(Build.Repository.LocalPath)/DerivedData
displayName: 'Clean DerivedData'
- script: |
sudo gem install cocoapods
displayName: 'Install CocoaPods Environment'
- script: |
yarn bundle ios
workingDirectory: $(Build.Repository.LocalPath)/apps/ios
displayName: 'yarn bundle iOS'
- script: |
yarn bundle macos
workingDirectory: $(Build.Repository.LocalPath)/apps/macos
displayName: 'yarn bundle macOS'
# Select proper Xcode version
- template: templates/apple-xcode-select.yml

- template: templates/apple-xcode-build-static-libs.yml

- template: templates/nuget-publish-dry-run.yml
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ Most components should use the compose framework as it offers the comprehensive
1. `index.ts`
- This is the file listed as `main` inside your package.json and simply exports other files.
1. `<new-component>.tsx`
- This is the file that imports your native view, and composes it into a component with slots, a theme, and design tokens.
- This is the file that will actually define your function component, and compose it into a higher order component with slots, theming, and design tokens.
- Note that we need the comment `/** @jsx withSlots */` at the top of this file. An explanation can be found in the comment at `packages/experimental/use-slots/src/withSlots.tsx`
1. `<new-component>.<types | settings | platform | blah>.tsx` (Optional)
- Optional extra files to subdivide your code however you see fit. You can also add platform specific files as you see fit.

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ To start developing in the repository you can:

After a successful yarn build, you can explore FluentUI Tester, our demo application to play with each of the controls. To run FluentUI Tester, please follow instructions in the [FluentUI Tester readme](./apps/fluent-tester/README.md).

### Prettier

This repo is set up to run [Prettier](https://prettier.io/). To run Prettier in fix mode on the repo, run `yarn prettier-fix` at the root of the Repo.

If you are using [VSCode](https://code.visualstudio.com/) as your editor, you can configure it to run Prettier on save. Prettier is a recommended extension for the repo. You can configure it to run by:

1. Installing the Prettier extension for VSCode
2. Going to Settings > Text Editor > Formatting > Check Format On Save

## Contributing

Please visit our [contribution guide](./CONTRIBUTING.md) for more information on contributing to this repo.
Expand Down
43 changes: 34 additions & 9 deletions apps/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,53 @@ Prereqs:

1. Make sure you have followed the [Getting Started](../../README.md) instructions to install packages and build the entire FluentUI React Native repository. I.e. from the root of the repo:

```
yarn && yarn build
```sh
yarn
yarn build
```

2. Then go into `apps/android` folder and simply run the the following

```
```sh
yarn android
```

Troubleshooting
## Dependencies

Dependencies are managed by
[`@rnx-kit/dep-check`](https://github.com/microsoft/rnx-kit/tree/main/packages/dep-check).
If you're looking to upgrade `react-native`, look for the `rnx-kit` section in
`/apps/android/package.json`:

```json
{
...
"rnx-kit": {
"reactNativeVersion": "^0.63",
"kitType": "app",
"bundle": {
...
}
```

Bump `reactNativeVersion`, and run `yarn rnx-dep-check --write`. This command
will ensure that all relevant packages are bumped correctly.

You can read more about this tool here:
[`@rnx-kit/dep-check` design document](https://github.com/microsoft/rnx-kit/blob/main/packages/dep-check/DESIGN.md)

## Troubleshooting

- The first time you run your project, you may get errors about missing SDKs. Android Studio usually provides quick options to resolve these issues, but you can also go to Tools->SDK Manager to manually install or update SDK platforms or tools for your project.

- If you would like to debug in Android Studio, you can do the following to open the project there:

```
# Android
open -a "Android Studio" .
```sh
# macOS
open -a "Android Studio" .

# Windows
# Easiest to open from within Android Studio - see picture below
# Windows
# Easiest to open from within Android Studio - see picture below
```

![On Windows, it is easiest to open from within Android Studio, and the folder will show an Android Studio icon.](./../../assets/fluent_tester_android_windows_open.png)
Expand Down
28 changes: 20 additions & 8 deletions apps/android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,53 @@
"prettier-fix": "fluentui-scripts prettier --fix true"
},
"dependencies": {
"@fluentui-react-native/tester": "^0.26.0",
"@fluentui-react-native/tester": "^0.31.1",
"@react-native-community/slider": "^3.0.3",
"@react-native-picker/picker": "^1.9.11",
"hermes-engine": "~0.5.0",
"react": "16.13.1",
"react-native": "^0.63.4",
"react-native-svg": "^12.1.1",
"react-native-test-app": "^0.3.2"
"react-native": "^0.63.2",
"react-native-svg": "^12.1.1"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^1.1.0",
"@rnx-kit/cli": "^0.0.3",
"@rnx-kit/cli": "^0.5.27",
"@uifabricshared/build-native": "^0.1.1",
"@uifabricshared/eslint-config-rules": "^0.1.1",
"babel-jest": "^24.9.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-native-svg-transformer": "^0.14.3",
"react-native-test-app": "^0.6.3",
"react-test-renderer": "~16.13.1"
},
"jest": {
"preset": "react-native"
},
"rnx-kit": {
"reactNativeVersion": "^0.63",
"kitType": "app",
"bundle": {
"targets": [
"android"
],
"entryPath": "index.js"
}
},
"capabilities": [
"core-android",
"hermes",
"react",
"test-app"
]
},
"depcheck": {
"ignoreMatches": [
"react-native-test-app",
"@react-native-picker/picker"
"@react-native-community/slider",
"@react-native-picker/picker",
"hermes-engine",
"react-native-test-app"
]
}
}
8 changes: 5 additions & 3 deletions apps/android/src/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
buildscript {
ext.kotlin_version = "1.3.72"
def androidTestAppDir = "../../../node_modules/react-native-test-app/android"
apply from: "$androidTestAppDir/dependencies.gradle"

repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.android.tools.build:gradle:$androidPluginVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
Binary file modified apps/android/src/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions apps/android/src/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Aug 19 04:22:25 PDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
53 changes: 33 additions & 20 deletions apps/android/src/gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -66,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -109,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand All @@ -138,19 +156,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -159,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
Loading

0 comments on commit 7721dee

Please sign in to comment.