Skip to content

Commit

Permalink
cli lib restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
aatxe committed Dec 17, 2024
1 parent 7ab3482 commit 9dc6f30
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 48 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions CLI/Analyze.cpp → CLI/src/Analyze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include "Luau/TypeAttach.h"
#include "Luau/Transpiler.h"

#include "FileUtils.h"
#include "Flags.h"
#include "Require.h"
#include "Luau/FileUtils.h"
#include "Luau/Flags.h"
#include "Luau/Require.h"

#include <condition_variable>
#include <functional>
Expand Down
2 changes: 1 addition & 1 deletion CLI/Ast.cpp → CLI/src/Ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "Luau/ParseOptions.h"
#include "Luau/ToString.h"

#include "FileUtils.h"
#include "Luau/FileUtils.h"

static void displayHelp(const char* argv0)
{
Expand Down
4 changes: 2 additions & 2 deletions CLI/Bytecode.cpp → CLI/src/Bytecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "Luau/BytecodeBuilder.h"
#include "Luau/Parser.h"
#include "Luau/BytecodeSummary.h"
#include "FileUtils.h"
#include "Flags.h"
#include "Luau/FileUtils.h"
#include "Luau/Flags.h"

#include <memory>

Expand Down
4 changes: 2 additions & 2 deletions CLI/Compile.cpp → CLI/src/Compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "Luau/Parser.h"
#include "Luau/TimeTrace.h"

#include "FileUtils.h"
#include "Flags.h"
#include "Luau/FileUtils.h"
#include "Luau/Flags.h"

#include <memory>

Expand Down
2 changes: 1 addition & 1 deletion CLI/Coverage.cpp → CLI/src/Coverage.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
#include "Coverage.h"
#include "Luau/Coverage.h"

#include "lua.h"

Expand Down
2 changes: 1 addition & 1 deletion CLI/FileUtils.cpp → CLI/src/FileUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
#include "FileUtils.h"
#include "Luau/FileUtils.h"

#include "Luau/Common.h"

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion CLI/Reduce.cpp → CLI/src/Reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "Luau/Parser.h"
#include "Luau/Transpiler.h"

#include "FileUtils.h"
#include "Luau/FileUtils.h"

#include <algorithm>
#include <stdio.h>
Expand Down
12 changes: 6 additions & 6 deletions CLI/Repl.cpp → CLI/src/Repl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
#include "Repl.h"
#include "Luau/Repl.h"

#include "Luau/Common.h"
#include "lua.h"
Expand All @@ -10,11 +10,11 @@
#include "Luau/Parser.h"
#include "Luau/TimeTrace.h"

#include "Coverage.h"
#include "FileUtils.h"
#include "Flags.h"
#include "Profiler.h"
#include "Require.h"
#include "Luau/Coverage.h"
#include "Luau/FileUtils.h"
#include "Luau/Flags.h"
#include "Luau/Profiler.h"
#include "Luau/Require.h"

#include "isocline.h"

Expand Down
2 changes: 1 addition & 1 deletion CLI/ReplEntry.cpp → CLI/src/ReplEntry.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
#include "Repl.h"
#include "Luau/Repl.h"

int main(int argc, char** argv)
{
Expand Down
6 changes: 3 additions & 3 deletions CLI/Require.cpp → CLI/src/Require.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
#include "Require.h"
#include "Luau/Require.h"

#include "FileUtils.h"
#include "Luau/FileUtils.h"
#include "Luau/Common.h"
#include "Luau/Config.h"

Expand Down Expand Up @@ -301,4 +301,4 @@ bool RequireResolver::parseConfigInDirectory(const std::string& directory)
}

return true;
}
}
File renamed without changes.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ include(Sources.cmake)
target_include_directories(Luau.Common INTERFACE Common/include)

target_compile_features(Luau.CLI.lib PUBLIC cxx_std_17)
target_include_directories(Luau.CLI.lib PUBLIC CLI/include)
target_link_libraries(Luau.CLI.lib PRIVATE Luau.Common)

target_compile_features(Luau.Ast PUBLIC cxx_std_17)
Expand Down
51 changes: 27 additions & 24 deletions Sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -389,36 +389,38 @@ target_sources(isocline PRIVATE

# Common sources shared between all CLI apps
target_sources(Luau.CLI.lib PRIVATE
CLI/FileUtils.cpp
CLI/Flags.cpp
CLI/Flags.h
CLI/FileUtils.h
CLI/include/Luau/FileUtils.h
CLI/include/Luau/Flags.h

CLI/src/FileUtils.cpp
CLI/src/Flags.cpp
)

if(TARGET Luau.Repl.CLI)
# Luau.Repl.CLI Sources
target_sources(Luau.Repl.CLI PRIVATE
CLI/Coverage.h
CLI/Coverage.cpp
CLI/Profiler.h
CLI/Profiler.cpp
CLI/Repl.cpp
CLI/ReplEntry.cpp
CLI/Require.cpp)
CLI/include/Luau/Coverage.h
CLI/include/Luau/Profiler.h

CLI/src/Coverage.cpp
CLI/src/Profiler.cpp
CLI/src/Repl.cpp
CLI/src/ReplEntry.cpp
CLI/src/Require.cpp)
endif()

if(TARGET Luau.Analyze.CLI)
# Luau.Analyze.CLI Sources
target_sources(Luau.Analyze.CLI PRIVATE
CLI/Analyze.cpp
CLI/Require.cpp
CLI/src/Analyze.cpp
CLI/src/Require.cpp
)
endif()

if(TARGET Luau.Ast.CLI)
# Luau.Ast.CLI Sources
target_sources(Luau.Ast.CLI PRIVATE
CLI/Ast.cpp
CLI/src/Ast.cpp
)
endif()

Expand Down Expand Up @@ -543,12 +545,13 @@ endif()
if(TARGET Luau.CLI.Test)
# Luau.CLI.Test Sources
target_sources(Luau.CLI.Test PRIVATE
CLI/Coverage.h
CLI/Coverage.cpp
CLI/Profiler.h
CLI/Profiler.cpp
CLI/Repl.cpp
CLI/Require.cpp
CLI/include/Luau/Coverage.h
CLI/include/Luau/Profiler.h

CLI/src/Coverage.cpp
CLI/src/Profiler.cpp
CLI/src/Repl.cpp
CLI/src/Require.cpp

tests/RegisterCallbacks.h
tests/RegisterCallbacks.cpp
Expand All @@ -560,24 +563,24 @@ endif()
if(TARGET Luau.Web)
# Luau.Web Sources
target_sources(Luau.Web PRIVATE
CLI/Web.cpp)
CLI/src/Web.cpp)
endif()

if(TARGET Luau.Reduce.CLI)
# Luau.Reduce.CLI Sources
target_sources(Luau.Reduce.CLI PRIVATE
CLI/Reduce.cpp
CLI/src/Reduce.cpp
)
endif()

if(TARGET Luau.Compile.CLI)
# Luau.Compile.CLI Sources
target_sources(Luau.Compile.CLI PRIVATE
CLI/Compile.cpp)
CLI/src/Compile.cpp)
endif()

if(TARGET Luau.Bytecode.CLI)
# Luau.Bytecode.CLI Sources
target_sources(Luau.Bytecode.CLI PRIVATE
CLI/Bytecode.cpp)
CLI/src/Bytecode.cpp)
endif()
2 changes: 1 addition & 1 deletion tests/Repl.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "lua.h"
#include "lualib.h"

#include "Repl.h"
#include "Luau/Repl.h"
#include "ScopedFlags.h"

#include "doctest.h"
Expand Down
4 changes: 2 additions & 2 deletions tests/RequireByString.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include "lua.h"
#include "lualib.h"

#include "Repl.h"
#include "FileUtils.h"
#include "Luau/Repl.h"
#include "Luau/FileUtils.h"

#include "doctest.h"

Expand Down

0 comments on commit 9dc6f30

Please sign in to comment.