GeezerVison is showing github.com — Java first test · nuswgg/Lean@a0f2c4d
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Algorithm.Java/QuantConnect.Algorithm.Java.csproj +7-5Lines changed: 7 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
137 | 137 | </ItemGroup> |
138 | 138 | <ItemGroup> |
139 | 139 | <None Include="build.bat"> |
140 | | - <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| 140 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 141 | + </None> |
| 142 | + <None Include="build.sh"> |
| 143 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
141 | 144 | </None> |
142 | | - <None Include="build.sh" /> |
143 | 145 | <None Include="packages.config" /> |
144 | 146 | </ItemGroup> |
145 | 147 | <ItemGroup> |
|
162 | 164 | </ItemGroup> |
163 | 165 | <ItemGroup> |
164 | 166 | <Content Include="BasicTemplateAlgorithm.java"> |
165 | | - <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| 167 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
166 | 168 | </Content> |
| 169 | + <None Include="readme.md" /> |
167 | 170 | </ItemGroup> |
168 | 171 | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
169 | 172 | <PropertyGroup> |
170 | 173 | <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' "> |
171 | 174 | build |
172 | 175 | </PostBuildEvent> |
173 | 176 | <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> |
174 | | - chmod 755 build.sh |
175 | | - ./build.sh |
| 177 | + chmod 755 build.sh & ./build.sh |
176 | 178 | </PostBuildEvent> |
177 | 179 | </PropertyGroup> |
178 | 180 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|
Collapse file
Copy file name to clipboard +20-1Lines changed: 20 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +REM Set the location of your .NET Framework |
1 | 2 | SET dotnet_framework="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5" |
| 3 | + |
| 4 | +REM Set the location of your Java Compiler. |
| 5 | +SET javaCompilerx64="C:\Program Files\Java\jdk1.7.0_80\bin\javac.exe" |
| 6 | +SET javaCompilerx86="C:\Program Files (x86)\Java\jdk1.7.0_80\bin\javac.exe" |
| 7 | + |
| 8 | + |
2 | 9 | ikvmstub -nostdlib %dotnet_framework%\mscorlib.dll |
3 | 10 | ikvmstub -nostdlib -r:%dotnet_framework%\mscorlib.dll QuantConnect.Algorithm.dll |
4 | 11 | ikvmstub -nostdlib -r:%dotnet_framework%\mscorlib.dll QuantConnect.Interfaces.dll |
5 | 12 | ikvmstub -nostdlib -r:%dotnet_framework%\mscorlib.dll -r:%dotnet_framework%\System.dll -r:%dotnet_framework%\System.Core.dll -r:%dotnet_framework%\System.Xml.Linq.dll QuantConnect.Common.dll |
6 | | -javac -cp QuantConnect.Algorithm.jar;QuantConnect.Interfaces.jar;mscorlib.jar;QuantConnect.common.jar *.java |
| 13 | + |
| 14 | +:CheckOS |
| 15 | +IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT) |
| 16 | + |
| 17 | +:64BIT |
| 18 | + %javaCompilerx64% -cp QuantConnect.Algorithm.jar;QuantConnect.Interfaces.jar;mscorlib.jar;QuantConnect.common.jar *.java |
| 19 | +GOTO END |
| 20 | + |
| 21 | +:32BIT |
| 22 | + %javaCompilerx86% -cp QuantConnect.Algorithm.jar;QuantConnect.Interfaces.jar;mscorlib.jar;QuantConnect.common.jar *.java |
| 23 | +GOTO END |
| 24 | + |
| 25 | +:END |
7 | 26 | ikvmc -debug -target:library -out:QuantConnect.Algorithm.Java.dll -nostdlib -r:QuantConnect.Common.dll -r:QuantConnect.Indicators.dll -r:QuantConnect.Algorithm.dll -r:QuantConnect.Interfaces.dll -r:Newtonsoft.json.dll -r:%dotnet_framework%\mscorlib.dll -r:%dotnet_framework%\System.dll -r:%dotnet_framework%\System.Core.dll -r:%dotnet_framework%\System.Xml.Linq.dll *.class |
Collapse file
Copy file name to clipboard +15Lines changed: 15 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +@ECHO OFF |
| 2 | + |
| 3 | +SET javaCompiler=Not Found |
| 4 | + |
| 5 | +SET javaCompilerx64="C:\Program Files\Java\jdk1.7.0_80\bin\javac.exe" |
| 6 | +SET javaCompilerx86="C:\Program Files (x86)\Java\jdk1.7.0_80\bin\javac.exe" |
| 7 | + |
| 8 | + |
| 9 | +dir "%javaCompilerx64%" > NUL 2>&1 |
| 10 | + |
| 11 | +if not errorlevel 1 ( |
| 12 | + echo Directory exists. |
| 13 | +) else ( |
| 14 | + echo Directory does not exist. |
| 15 | +) |
Collapse file
Copy file name to clipboard +17Lines changed: 17 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +29th June 2015: LEAN Algorithmic Trading Engine Java Interop |
| 2 | +Jared Broad (@jaredbroad) & Craig Stevenson (@craig-stevenson) |
| 3 | +===== |
| 4 | +This is the Java-C# Interop project for connecting LEAN and Java Algorithms. Points to note: |
| 5 | + |
| 6 | +1. The project uses IKVM which requires version 1.7 of Java. You can obtain this here: |
| 7 | +Download the 1.7.80 SDK and install it. http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html |
| 8 | + |
| 9 | +2. After installation confirm your "javac.exe" directory is one of the following: |
| 10 | + 64 bit systems -- "C:\Program Files\Java\jdk1.7.0_80\bin\javac.exe" |
| 11 | + 32 bit systems -- "C:\Program Files (x86)\Java\jdk1.7.0_80\bin\javac.exe" |
| 12 | + |
| 13 | +3. Build! Hopefully that is all that is required. Your DLL will output to "QuantConnect.Algorithm.Java.dll" in the binary directory. |
| 14 | + |
| 15 | +If you get any build errors in the Java project it probably means you have a Java error. We recommend developing in Eclipse to fix these errors before using Lean. |
| 16 | + |
| 17 | +If the error persists, then check the "output" tab of visual studio to read the error message from the raw build logs. |