Skip to content

Adapted to unreal version 4.20. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace UnrealBuildTool.Rules
{
public class EclipseSourceCodeAccess : ModuleRules
{
public EclipseSourceCodeAccess(TargetInfo Target)
public EclipseSourceCodeAccess(ReadOnlyTargetRules Target) : base(Target)
{
PrivateDependencyModuleNames.AddRange(
new string[]
Expand All @@ -13,7 +13,7 @@ public EclipseSourceCodeAccess(TargetInfo Target)
}
);

if (UEBuildConfiguration.bBuildEditor)
if (Target.bBuildEditor)
{
PrivateDependencyModuleNames.Add("HotReload");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "EclipseSourceCodeAccessModule.h"
#include "EclipseSourceCodeAccessPrivatePCH.h"
#include "Runtime/Core/Public/Features/IModularFeatures.h"
#include "EclipseSourceCodeAccessModule.h"

IMPLEMENT_MODULE(FEclipseSourceCodeAccessModule, EclipseSourceCodeAccess);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once

#include "EclipseSourceCodeAccessor.h"
#include "Modules/ModuleInterface.h"


class FEclipseSourceCodeAccessModule : public IModuleInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#include "Core.h"
#include "ModuleManager.h"
#include "Modules/ModuleManager.h"
#include "ISourceCodeAccessModule.h"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "EclipseSourceCodeAccessPrivatePCH.h"
#include "EclipseSourceCodeAccessor.h"
#include "ModuleManager.h"
#include "EclipseSourceCodeAccessPrivatePCH.h"
#include "Modules/ModuleManager.h"
#include "DesktopPlatformModule.h"

#if WITH_EDITOR
Expand Down Expand Up @@ -55,6 +55,36 @@ bool FEclipseSourceCodeAccessor::OpenSolution()
return false;
}

bool FEclipseSourceCodeAccessor::DoesSolutionExist() const
{
if (IsInGameThread())
{
FString SolutionPath;
return FDesktopPlatformModule::Get()->GetSolutionPath(SolutionPath);
}
return false;
}


bool FEclipseSourceCodeAccessor::OpenSolutionAtPath(const FString& InSolutionPath)
{
FString EclipsePath;
if (!CanRunEclipse(EclipsePath))
{
return false;
}

UE_LOG(LogEclipseAccessor, Warning, TEXT("FEclipseSourceCodeAccessor::OpenSolution: %s %s"), *EclipsePath, *InSolutionPath);

FProcHandle Proc = FPlatformProcess::CreateProc(*EclipsePath, *InSolutionPath, true, false, false, nullptr, 0, nullptr, nullptr);
if (Proc.IsValid())
{
FPlatformProcess::CloseProc(Proc);
return true;
}
return false;
}

bool FEclipseSourceCodeAccessor::OpenFileAtLine(const FString& FullPath, int32 LineNumber, int32 ColumnNumber)
{
TArray<FString> Files;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ class FEclipseSourceCodeAccessor : public ISourceCodeAccessor
*/
virtual FText GetDescriptionText() const override;

virtual bool DoesSolutionExist() const override;

/**
* Open the CodeLite Workspace for editing.
*/
virtual bool OpenSolution() override;

/**
* Open the CodeLite Workspace for editing.
*/
virtual bool OpenSolutionAtPath(const FString& InSolutionPath) override;

/**
* Open a file at a specific line and optional column.
*/
Expand Down