GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nissl-lab/JavaToCSharp: a lightweight tool can help convert Java code to C# code

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
Configuration
Configuration
 
 
Properties
Properties
 
 
Rules
Rules
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
App.config
App.config
 
 
IRule.cs
IRule.cs
 
 
JavaToCSharp.csproj
JavaToCSharp.csproj
 
 
JavaToCSharp.sln
JavaToCSharp.sln
 
 
LICENSE
LICENSE
 
 
Program.cs
Program.cs
 
 
README.md
README.md
 
 
RuleEngine.cs
RuleEngine.cs
 
 

Repository files navigation

Java2CSharp

a lightweight tool can help convert Java code to C# code. The tool is a batch of replacement rules and a configuration file to set up the rules. It used to be located in npoi repo/tools/JavaToCSharp

Story of Java2CSharp tool

At the very beginning of NPOI development, it's very hard and boring job to convert Java code to C# in the first and second year. Then I started writing this tool to help convert Java to C# as quick as possible. Anyway, this tool did help a lot in the development of NPOI and let me focus on fixing bugs instead of repeat the replacement action again and again.

How to setup this tool

Open app.config and add new rules into rules node under the J2CS section

<J2CS>
    <Rules>
      <add name="Array.Copy" pattern="System\.arraycopy" replacement="Array.Copy"/>
      <add name="toByteArray" pattern="toByteArray" replacement="ToArray"/>
      <add name="Character.isLetter" pattern="Character.isLetter" replacement="Character\.isLetter"/>
      ...
    </Rules>
</J2CS>

PowerShell scripts

To convert a single file, run .\JavaToCSharp <filename>

To convert a batch of files under the folder, call scripts/run.ps1

About

a lightweight tool can help convert Java code to C# code

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

26 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.