Skip to content

Commit

Permalink
Add C# client. (google#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
seithuhtun committed Nov 16, 2021
1 parent 91c2b57 commit 7a9ef50
Show file tree
Hide file tree
Showing 29 changed files with 2,926 additions and 4 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/mynmr_tools_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,38 @@ jobs:
- name: Run dart tests
run: |
cd clients/dart
flutter test
flutter test
# C# Client on Ubuntu
C_Sharp_Ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0'
- name: Install dependencies
run: |
cd clients/c#
dotnet restore
- name: Run tests
run: |
cd clients/c#
dotnet test
# C# Client on Windows
C_Sharp_Windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0'
- name: Install dependencies
run: |
cd clients/c#
dotnet restore
- name: Run tests
run: |
cd clients/c#
dotnet test
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GO=go
PHPUNIT=./vendor/bin/phpunit
PYTHON=python
FLUTTER=flutter
DOTNET=dotnet

# /usr/bin/swift is under macOS System Integrity Protection, which
# filters out environment variables like DYLD_LIBRARY_PATH which let
Expand Down Expand Up @@ -61,6 +62,7 @@ copy-resources:
cp training/src/main/resources/com/google/myanmartools/zawgyiUnicodeModel.dat clients/go/resources
cp training/src/main/resources/com/google/myanmartools/zawgyiUnicodeModel.dat clients/python/src/myanmartools/resources
cp training/src/main/resources/com/google/myanmartools/zawgyiUnicodeModel.dat clients/dart/resources
cp training/src/main/resources/com/google/myanmartools/zawgyiUnicodeModel.dat clients/c#/Resources
cp training/src/main/resources/com/google/myanmartools/compatibility.tsv clients/java/src/test/resources/com/google/myanmartools
cp training/src/main/resources/com/google/myanmartools/compatibility.tsv clients/cpp/resources
cp training/src/main/resources/com/google/myanmartools/compatibility.tsv clients/js/resources
Expand All @@ -69,19 +71,24 @@ copy-resources:
cp training/src/main/resources/com/google/myanmartools/compatibility.tsv clients/go/resources
cp training/src/main/resources/com/google/myanmartools/compatibility.tsv clients/python/src/myanmartools/resources
cp training/src/main/resources/com/google/myanmartools/compatibility.tsv clients/dart/resources
cp training/src/main/resources/com/google/myanmartools/compatibility.tsv clients/c#/Resources

cp genconvert/input/mmgov_zawgyi_src.txt clients/java/src/test/resources/com/google/myanmartools
cp genconvert/input/mmgov_zawgyi_src.txt clients/js/resources
cp genconvert/input/mmgov_zawgyi_src.txt clients/dart/resources
cp genconvert/input/mmgov_zawgyi_src.txt clients/c#/Resources
cp genconvert/input/udhr_mya_unicode_src.txt clients/js/resources
cp genconvert/input/udhr_mya_unicode_src.txt clients/java/src/test/resources/com/google/myanmartools
cp genconvert/input/udhr_mya_unicode_src.txt clients/dart/resources
cp genconvert/input/udhr_mya_unicode_src.txt clients/c#/Resources
cp genconvert/output/mmgov_unicode_out.txt clients/java/src/test/resources/com/google/myanmartools
cp genconvert/output/mmgov_unicode_out.txt clients/js/resources
cp genconvert/output/mmgov_unicode_out.txt clients/dart/resources
cp genconvert/output/mmgov_unicode_out.txt clients/c#/Resources
cp genconvert/output/udhr_mya_zawgyi_out.txt clients/java/src/test/resources/com/google/myanmartools
cp genconvert/output/udhr_mya_zawgyi_out.txt clients/js/resources
cp genconvert/output/udhr_mya_zawgyi_out.txt clients/dart/resources
cp genconvert/output/udhr_mya_zawgyi_out.txt clients/c#/Resources

train: zawgyiUnicodeModel.dat compatibility.tsv testData.tsv copy-resources

Expand Down Expand Up @@ -133,6 +140,9 @@ client-python: $(wildcard clients/python/**/*)
client-dart:$(wildcard clients/dart/**/*)
cd clients/dart && $(FLUTTER) pub get

client-csharp:$(wildcard clients/c#/**/*)
cd clients/c# && $(DOTNET) restore

# Until Swift 5.3 and SE-0272 are released, the Swift Package Manager
# does not fully support binary library dependencies.
#
Expand All @@ -158,7 +168,7 @@ client-swift: client-cpp $(wildcard clients/swift/**/*)
client-swift-test: client-swift
DYLD_LIBRARY_PATH="$(CURDIR)"/clients/cpp $(SWIFT) test -Xlinker -L"$(CURDIR)"/clients/cpp --package-path clients/swift

test: clients client-cpp client-js client-ruby client-php client-go client-python client-swift client-swift-test client-dart
test: clients client-cpp client-js client-ruby client-php client-go client-python client-swift client-swift-test client-dart client-csharp
cd clients/cpp && $(MAKE) test
cd clients/java && $(MVN) test
cd clients/js && $(NPM) test
Expand All @@ -167,3 +177,4 @@ test: clients client-cpp client-js client-ruby client-php client-go client-pytho
$(PHPUNIT) --configuration clients/php/phpunit.xml
cd clients/python && $(PYTHON) -m unittest
cd clients/dart && $(FLUTTER) test
cd clients/c# && $(DOTNET) test
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Unofficial demos:
Features:

- Detect whether a string is Zawgyi or Unicode.
- Supported in C++, Java, JavaScript (both Node.js and browser), PHP, and Ruby
- Supported in C++, Java, JavaScript (both Node.js and browser), PHP, Ruby, Dart and C#
- Convert a string from Zawgyi to Unicode or from Unicode to Zawgyi
- Supported in Java and JavaScript

Expand Down Expand Up @@ -38,6 +38,8 @@ See language-specific documentation:
- [Python](clients/python/README.rst)
- [Ruby](clients/ruby/README.md)
- [Swift](clients/swift/README.md)
- [Dart](clients/dart/README.md)
- [C#](clients/c%23/README.md)

Depending on your programming language, a typical use case should look something like this:

Expand Down
Loading

0 comments on commit 7a9ef50

Please sign in to comment.