diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1ff0c42..0000000 --- a/.gitattributes +++ /dev/null @@ -1,63 +0,0 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### -* text=auto - -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 68e3060..f71a78a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,407 @@ -packages/ -Debug/ -*/Debug/ -.vs/ \ No newline at end of file + +# Created by https://www.gitignore.io/api/c++,gradle,visualstudio +# Edit at https://www.gitignore.io/?templates=c++,gradle,visualstudio + +*.sln +*.vcxproj +*.vcxproj.filters +*.vcxproj.user + +### C++ ### +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +### Gradle ### +.gradle +build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +### Gradle Patch ### +**/build/ + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.iobj +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# End of https://www.gitignore.io/api/c++,gradle,visualstudio diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..144d61c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "libs/googletest"] + path = libs/googletest + url = https://github.com/google/googletest diff --git a/FalconLibraryCPP.sln b/FalconLibraryCPP.sln deleted file mode 100644 index 409d207..0000000 --- a/FalconLibraryCPP.sln +++ /dev/null @@ -1,41 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29009.5 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FalconLibraryCPP", "FalconLibraryCPP\FalconLibraryCPP.vcxproj", "{9F48B50F-67E0-4F56-99B6-586EA5FFFEBA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tests", "Tests\Tests.vcxproj", "{52260548-392E-4370-8760-D749F5BEBEE6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9F48B50F-67E0-4F56-99B6-586EA5FFFEBA}.Debug|x64.ActiveCfg = Debug|x64 - {9F48B50F-67E0-4F56-99B6-586EA5FFFEBA}.Debug|x64.Build.0 = Debug|x64 - {9F48B50F-67E0-4F56-99B6-586EA5FFFEBA}.Debug|x86.ActiveCfg = Debug|Win32 - {9F48B50F-67E0-4F56-99B6-586EA5FFFEBA}.Debug|x86.Build.0 = Debug|Win32 - {9F48B50F-67E0-4F56-99B6-586EA5FFFEBA}.Release|x64.ActiveCfg = Release|x64 - {9F48B50F-67E0-4F56-99B6-586EA5FFFEBA}.Release|x64.Build.0 = Release|x64 - {9F48B50F-67E0-4F56-99B6-586EA5FFFEBA}.Release|x86.ActiveCfg = Release|Win32 - {9F48B50F-67E0-4F56-99B6-586EA5FFFEBA}.Release|x86.Build.0 = Release|Win32 - {52260548-392E-4370-8760-D749F5BEBEE6}.Debug|x64.ActiveCfg = Debug|x64 - {52260548-392E-4370-8760-D749F5BEBEE6}.Debug|x64.Build.0 = Debug|x64 - {52260548-392E-4370-8760-D749F5BEBEE6}.Debug|x86.ActiveCfg = Debug|Win32 - {52260548-392E-4370-8760-D749F5BEBEE6}.Debug|x86.Build.0 = Debug|Win32 - {52260548-392E-4370-8760-D749F5BEBEE6}.Release|x64.ActiveCfg = Release|x64 - {52260548-392E-4370-8760-D749F5BEBEE6}.Release|x64.Build.0 = Release|x64 - {52260548-392E-4370-8760-D749F5BEBEE6}.Release|x86.ActiveCfg = Release|Win32 - {52260548-392E-4370-8760-D749F5BEBEE6}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E5EA9E50-DE77-48F2-AF5D-555E9A23AA53} - EndGlobalSection -EndGlobal diff --git a/FalconLibraryCPP.sln.DotSettings.user b/FalconLibraryCPP.sln.DotSettings.user deleted file mode 100644 index e13cfe1..0000000 --- a/FalconLibraryCPP.sln.DotSettings.user +++ /dev/null @@ -1,7 +0,0 @@ - - True - True - True - True - True - True \ No newline at end of file diff --git a/FalconLibraryCPP/FalconLibraryCPP.vcxproj b/FalconLibraryCPP/FalconLibraryCPP.vcxproj deleted file mode 100644 index 00a8117..0000000 --- a/FalconLibraryCPP/FalconLibraryCPP.vcxproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {9F48B50F-67E0-4F56-99B6-586EA5FFFEBA} - FalconLibraryCPP - 10.0 - - - - Application - true - v142 - MultiByte - - - Application - false - v142 - true - MultiByte - - - Application - true - v142 - MultiByte - - - Application - false - v142 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - - - Level3 - Disabled - true - true - - - Console - - - - - Level3 - Disabled - true - true - - - Console - - - - - Level3 - MaxSpeed - true - true - true - true - - - Console - true - true - - - - - Level3 - MaxSpeed - true - true - true - true - - - Console - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/FalconLibraryCPP/FalconLibraryCPP.vcxproj.filters b/FalconLibraryCPP/FalconLibraryCPP.vcxproj.filters deleted file mode 100644 index 3e8b72a..0000000 --- a/FalconLibraryCPP/FalconLibraryCPP.vcxproj.filters +++ /dev/null @@ -1,91 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/FalconLibraryCPP/FalconLibraryCPP.vcxproj.user b/FalconLibraryCPP/FalconLibraryCPP.vcxproj.user deleted file mode 100644 index 966b4ff..0000000 --- a/FalconLibraryCPP/FalconLibraryCPP.vcxproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - true - - \ No newline at end of file diff --git a/Tests/Tests.vcxproj b/Tests/Tests.vcxproj deleted file mode 100644 index f68abcb..0000000 --- a/Tests/Tests.vcxproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {52260548-392e-4370-8760-d749f5bebee6} - Win32Proj - 10.0.17763.0 - Application - v142 - Unicode - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - {9f48b50f-67e0-4f56-99b6-586ea5fffeba} - - - - - - - - - - - - - Use - pch.h - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level3 - - - true - Console - - - - - Use - pch.h - Disabled - X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level3 - - - true - Console - - - - - Use - pch.h - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - - - true - Console - true - true - - - - - Use - pch.h - X64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - - - true - Console - true - true - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/Tests/Tests.vcxproj.user b/Tests/Tests.vcxproj.user deleted file mode 100644 index 88a5509..0000000 --- a/Tests/Tests.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Tests/packages.config b/Tests/packages.config deleted file mode 100644 index 3c6fe17..0000000 --- a/Tests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Tests/pch.cpp b/Tests/pch.cpp deleted file mode 100644 index 97b544e..0000000 --- a/Tests/pch.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// -// pch.cpp -// Include the standard header and generate the precompiled header. -// - -#include "pch.h" diff --git a/Tests/pch.h b/Tests/pch.h deleted file mode 100644 index 29c81ff..0000000 --- a/Tests/pch.h +++ /dev/null @@ -1,8 +0,0 @@ -// -// pch.h -// Header for standard system include files. -// - -#pragma once - -#include "gtest/gtest.h" diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..20c6df3 --- /dev/null +++ b/build.gradle @@ -0,0 +1,39 @@ +plugins { + id "cpp" + id "google-test-test-suite" + id "visual-studio" +} + +model { + components { + falconlibrary(NativeLibrarySpec) { + sources.cpp { + source { + srcDir "src/cpp" + include "**/*.cpp" + } + exportedHeaders { + srcDir "src/include" + include "**/*.h" + } + } + } + } + binaries { + withType(GoogleTestTestSuiteBinarySpec) { + lib project: ":libs", library: "googleTest", linkage: "static" + } + } + testSuites { + falconlibraryTest(GoogleTestTestSuiteSpec) { + testing $.components.falconlibrary + + sources.cpp { + source { + srcDir "src/test/cpp" + include "**/*.cpp" + } + } + } + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..457aad0 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..d08253c --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=permwrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=permwrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..af6708f --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +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='"-Xmx64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +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 + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +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 + 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 + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((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" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +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" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..6d57edc --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/libs/build.gradle b/libs/build.gradle new file mode 100644 index 0000000..bd5be67 --- /dev/null +++ b/libs/build.gradle @@ -0,0 +1,21 @@ +apply plugin: "cpp" + +ext.libroot = new File(rootProject.rootDir, "libs") +ext.gtest_root = new File(libroot, "googletest/googletest") + +model { + components { + googleTest(NativeLibrarySpec) { + sources.cpp { + source { + srcDir new File(gtest_root, "src") + include "**/gtest-all.cc" + } + exportedHeaders { + srcDirs gtest_root, new File(gtest_root, "include") + include "**/*.hpp", "**/*.h" + } + } + } + } +} \ No newline at end of file diff --git a/libs/googletest b/libs/googletest new file mode 160000 index 0000000..437e100 --- /dev/null +++ b/libs/googletest @@ -0,0 +1 @@ +Subproject commit 437e1008c97b6bf595fec85da42c6925babd96b2 diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..60a833f --- /dev/null +++ b/settings.gradle @@ -0,0 +1,9 @@ +pluginManagement { + repositories { + mavenLocal() + gradlePluginPortal() + } +} + +include 'libs' +rootProject.name = 'FalconLibrary' \ No newline at end of file diff --git a/FalconLibraryCPP/src/FalconLibrary.h b/src/include/FalconLibrary.h similarity index 100% rename from FalconLibraryCPP/src/FalconLibrary.h rename to src/include/FalconLibrary.h diff --git a/FalconLibraryCPP/src/Utilities.h b/src/include/Utilities.h similarity index 100% rename from FalconLibraryCPP/src/Utilities.h rename to src/include/Utilities.h diff --git a/FalconLibraryCPP/src/mathematics/control/RamseteTracker.h b/src/include/mathematics/control/RamseteTracker.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/control/RamseteTracker.h rename to src/include/mathematics/control/RamseteTracker.h diff --git a/FalconLibraryCPP/src/mathematics/control/TrajectoryTracker.h b/src/include/mathematics/control/TrajectoryTracker.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/control/TrajectoryTracker.h rename to src/include/mathematics/control/TrajectoryTracker.h diff --git a/FalconLibraryCPP/src/mathematics/geometry/Pose2d.h b/src/include/mathematics/geometry/Pose2d.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/geometry/Pose2d.h rename to src/include/mathematics/geometry/Pose2d.h diff --git a/FalconLibraryCPP/src/mathematics/geometry/Pose2dWithCurvature.h b/src/include/mathematics/geometry/Pose2dWithCurvature.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/geometry/Pose2dWithCurvature.h rename to src/include/mathematics/geometry/Pose2dWithCurvature.h diff --git a/FalconLibraryCPP/src/mathematics/geometry/Rotation2d.h b/src/include/mathematics/geometry/Rotation2d.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/geometry/Rotation2d.h rename to src/include/mathematics/geometry/Rotation2d.h diff --git a/FalconLibraryCPP/src/mathematics/geometry/Translation2d.h b/src/include/mathematics/geometry/Translation2d.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/geometry/Translation2d.h rename to src/include/mathematics/geometry/Translation2d.h diff --git a/FalconLibraryCPP/src/mathematics/geometry/Twist2d.h b/src/include/mathematics/geometry/Twist2d.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/geometry/Twist2d.h rename to src/include/mathematics/geometry/Twist2d.h diff --git a/FalconLibraryCPP/src/mathematics/spline/ParametricQuinticHermiteSpline.h b/src/include/mathematics/spline/ParametricQuinticHermiteSpline.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/spline/ParametricQuinticHermiteSpline.h rename to src/include/mathematics/spline/ParametricQuinticHermiteSpline.h diff --git a/FalconLibraryCPP/src/mathematics/spline/ParametricSpline.h b/src/include/mathematics/spline/ParametricSpline.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/spline/ParametricSpline.h rename to src/include/mathematics/spline/ParametricSpline.h diff --git a/FalconLibraryCPP/src/mathematics/spline/SplineGenerator.h b/src/include/mathematics/spline/SplineGenerator.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/spline/SplineGenerator.h rename to src/include/mathematics/spline/SplineGenerator.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/DistanceTrajectory.h b/src/include/mathematics/trajectory/DistanceTrajectory.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/DistanceTrajectory.h rename to src/include/mathematics/trajectory/DistanceTrajectory.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/IndexedTrajectory.h b/src/include/mathematics/trajectory/IndexedTrajectory.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/IndexedTrajectory.h rename to src/include/mathematics/trajectory/IndexedTrajectory.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/TimedTrajectory.h b/src/include/mathematics/trajectory/TimedTrajectory.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/TimedTrajectory.h rename to src/include/mathematics/trajectory/TimedTrajectory.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/Trajectory.h b/src/include/mathematics/trajectory/Trajectory.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/Trajectory.h rename to src/include/mathematics/trajectory/Trajectory.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/TrajectoryGenerator.h b/src/include/mathematics/trajectory/TrajectoryGenerator.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/TrajectoryGenerator.h rename to src/include/mathematics/trajectory/TrajectoryGenerator.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/TrajectoryIterator.h b/src/include/mathematics/trajectory/TrajectoryIterator.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/TrajectoryIterator.h rename to src/include/mathematics/trajectory/TrajectoryIterator.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/constraints/AngularAccelerationConstraint.h b/src/include/mathematics/trajectory/constraints/AngularAccelerationConstraint.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/constraints/AngularAccelerationConstraint.h rename to src/include/mathematics/trajectory/constraints/AngularAccelerationConstraint.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/constraints/CentripetalAccelerationConstraint.h b/src/include/mathematics/trajectory/constraints/CentripetalAccelerationConstraint.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/constraints/CentripetalAccelerationConstraint.h rename to src/include/mathematics/trajectory/constraints/CentripetalAccelerationConstraint.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/constraints/TimingConstraint.h b/src/include/mathematics/trajectory/constraints/TimingConstraint.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/constraints/TimingConstraint.h rename to src/include/mathematics/trajectory/constraints/TimingConstraint.h diff --git a/FalconLibraryCPP/src/mathematics/trajectory/constraints/VelocityLimitRadiusConstraint.h b/src/include/mathematics/trajectory/constraints/VelocityLimitRadiusConstraint.h similarity index 100% rename from FalconLibraryCPP/src/mathematics/trajectory/constraints/VelocityLimitRadiusConstraint.h rename to src/include/mathematics/trajectory/constraints/VelocityLimitRadiusConstraint.h diff --git a/FalconLibraryCPP/src/types/Interpolatable.h b/src/include/types/Interpolatable.h similarity index 100% rename from FalconLibraryCPP/src/types/Interpolatable.h rename to src/include/types/Interpolatable.h diff --git a/FalconLibraryCPP/src/types/VaryInterpolatable.h b/src/include/types/VaryInterpolatable.h similarity index 100% rename from FalconLibraryCPP/src/types/VaryInterpolatable.h rename to src/include/types/VaryInterpolatable.h diff --git a/src/test/cpp/Main.cpp b/src/test/cpp/Main.cpp new file mode 100644 index 0000000..2812782 --- /dev/null +++ b/src/test/cpp/Main.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/Tests/geometry-tests.cpp b/src/test/cpp/geometry-tests.cpp similarity index 89% rename from Tests/geometry-tests.cpp rename to src/test/cpp/geometry-tests.cpp index 64b5288..e349ed4 100644 --- a/Tests/geometry-tests.cpp +++ b/src/test/cpp/geometry-tests.cpp @@ -1,5 +1,5 @@ -#include "pch.h" -#include "../FalconLibraryCPP/src/FalconLibrary.h" +#include +#include "FalconLibrary.h" constexpr double kTestEpsilon = 1E-9; diff --git a/Tests/ramsete-tests.cpp b/src/test/cpp/ramsete-tests.cpp similarity index 91% rename from Tests/ramsete-tests.cpp rename to src/test/cpp/ramsete-tests.cpp index 33eff15..3f4fd10 100644 --- a/Tests/ramsete-tests.cpp +++ b/src/test/cpp/ramsete-tests.cpp @@ -1,5 +1,5 @@ -#include "pch.h" -#include "../FalconLibraryCPP/src/FalconLibrary.h" +#include +#include "FalconLibrary.h" class RamseteTest : public ::testing::Test { public: diff --git a/Tests/trajectory-tests.cpp b/src/test/cpp/trajectory-tests.cpp similarity index 96% rename from Tests/trajectory-tests.cpp rename to src/test/cpp/trajectory-tests.cpp index f525a94..e7b7841 100644 --- a/Tests/trajectory-tests.cpp +++ b/src/test/cpp/trajectory-tests.cpp @@ -1,5 +1,5 @@ -#include "pch.h" -#include "../FalconLibraryCPP/src/FalconLibrary.h" +#include +#include "FalconLibrary.h" constexpr double kTestEpsilon = 1E-6;