Skip to content

Commit

Permalink
ci: set up lint (#29)
Browse files Browse the repository at this point in the history
* ci: set up lint

* style: fix lint errors

* fix: includes ordering
  • Loading branch information
nattb8 authored Oct 18, 2023
1 parent d818d1a commit 94b830a
Show file tree
Hide file tree
Showing 68 changed files with 3,257 additions and 3,277 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
#################################
#################################
## Super Linter GitHub Actions ##
#################################
#################################
name: Lint Code Base

#############################
# Start the job on all push #
#############################
on:
push:
branches-ignore: [main]
# Remove the line above to run when pushing to master
pull_request:
branches: [main]

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

############################################
# Grant status permission for MULTI_STATUS #
############################################
permissions:
contents: read
packages: read
statuses: write

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper
# list of changed files within `super-linter`
fetch-depth: 0

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_MARKDOWN: false
VALIDATE_GITLEAKS: false
VALIDATE_JSCPD: false
VALIDATE_JAVA: false
VALIDATE_GOOGLE_JAVA_FORMAT: false
1 change: 1 addition & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
filter=-whitespace,-legal/copyright,-readability/todo,-build/header_guard,-build/include_order
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ You must register your application as an OAuth 2.0 **Native** client.
The name you wish to use to identify your application.

#### Logout URLs
Native clients don't make use of Logout URLs, you might set your own website or https://localhost:3000 as this is a required field.
Native clients don't make use of Logout URLs, you might set your own site or https://localhost:3000 as this is a required field.

#### Callback URLs
On Android, iOS and macOS clients, you should set your application's deep link scheme (e.g. `mygame://callback`) if you wish to make use of [PKCE login](#android-and-ios-pkce-login-unreal-engine-50-only), otherwise set the same as [Logout URLs](#logout-urls).
Expand All @@ -59,7 +59,7 @@ See [here](https://docs.immutable.com/docs/x/passport/register-application/) for
>[git-lfs](https://git-lfs.github.com/): since `.uasset` and `.umap` files are stored on Git Large File Storage, ensure you have [git-lfs]((https://git-lfs.github.com/)) installed.
1. Clone the [unreal-immutable-sdk](https://github.com/immutable/unreal-immutable-sdk) repository or download the zip/tarball from one of the versions [here](https://github.com/immutable/unreal-immutable-sdk/tags)
2. Copy the cloned repo into your project's `Plugins` folder, e.g.: `MyGame/Plugins/unreal-immutable-sdk`.
2. Copy the cloned repository into your project's `Plugins` folder, e.g.: `MyGame/Plugins/unreal-immutable-sdk`.
3. Restart your project (Unreal Editor & Rider), upon restart it should load the `unreal-sdk-plugin` and should be good to use.

> [!NOTE]
Expand Down Expand Up @@ -209,7 +209,7 @@ See the [ImmutablePassport.h](https://github.com/immutable/unreal-immutable-sdk/
- Epic Games Launcher
- Unreal Engine installed from the Epic Games Launcher; you will need every version that the plugin supports (currently 4.27, 5.0, 5.1, 5.2)
- Visual Studio 2022 with C++ support
- Jetbrains Rider IDE (recommended for working with Unreal Engine C++ code)
- JetBrains Rider IDE (recommended for working with Unreal Engine C++ code)

If not Rider, Visual Studio is fine and even better with the Resharper plugin.

Expand All @@ -229,13 +229,13 @@ In Unreal Engine 5.1+ the project is set up so that `console.log()` will pass al

#### Remote Debugging

To set up Chromium remote debugging, edit project build/launch configurations in your IDE to add the following program command line argument to the appropriate configurations: `cefdebug=9222`
To set up Chromium remote debugging, edit project build/launch configurations in your IDE to add the following program command-line argument to the appropriate configurations: `cefdebug=9222`

Next, launch the game and then open a separate Chrome/Chromium browser and navigate to `chrome://inspect` where your app should be listed, sometimes intermittently or after a delay, under the `Remote Target #localhost` section. Click `inspect` to launch the remote debugging session.

## Release Unreal Immutable SDK Plugin

1. Release the plugin using github releases. See https://github.com/immutable/unreal-immutable-sdk/releases
1. Release the plugin using GitHub releases. See https://github.com/immutable/unreal-immutable-sdk/releases

## Release Blui Plugin for UE4

Expand All @@ -249,7 +249,7 @@ For UE4 we are using Blui as the in built browser does not work.
```
// BluManager::Settings.remote_debugging_port = 7777;
```
6. Zip the Blui plugin folder and upload to the github release.
6. Zip the Blui plugin folder and upload to the GitHub release.

## How to Add Game Bridge Asset to Packaged Resources

Expand Down
176 changes: 88 additions & 88 deletions Source/Immutable/Immutable.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,114 +6,114 @@

public class Immutable : ModuleRules
{
public Immutable(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
#if UE_5_1_OR_LATER
public Immutable(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

#if UE_5_1_OR_LATER
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
#endif
#endif

PublicIncludePaths.AddRange(
new string[]
{
PublicIncludePaths.AddRange(
new string[]
{
// ... add public include paths required here ...
}
);
);


PrivateIncludePaths.AddRange(
new string[]
{
PrivateIncludePaths.AddRange(
new string[]
{
// ... add other private include paths required here ...
}
);
);


PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
// ... add other public dependencies that you statically link with here ...
}
);


PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"Json",
"JsonUtilities",
"UMG",
"Projects",
);


PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"Json",
"JsonUtilities",
"UMG",
"Projects",
// ... add private dependencies that you statically link with here ...
}
);
#if UE_5_0_OR_LATER
);

#if UE_5_0_OR_LATER
PublicDependencyModuleNames.Add("WebBrowserWidget");
PrivateDependencyModuleNames.Add("WebBrowser");
PublicDefinitions.Add("USING_BUNDLED_CEF=1");
PublicDefinitions.Add("USING_BLUI_CEF=0");
#else
if (Target.Platform == UnrealTargetPlatform.Win64)
{
PrivateDependencyModuleNames.Add("Blu");
PublicDefinitions.Add("USING_BLUI_CEF=1");
}
else
{
PublicDefinitions.Add("USING_BLUI_CEF=0");
}
#else
if (Target.Platform == UnrealTargetPlatform.Win64)
{
PrivateDependencyModuleNames.Add("Blu");
PublicDefinitions.Add("USING_BLUI_CEF=1");
}
else
{
PublicDefinitions.Add("USING_BLUI_CEF=0");
}

PublicDefinitions.Add("USING_BUNDLED_CEF=0");
#endif
PublicDefinitions.Add("USING_BUNDLED_CEF=0");
#endif

DynamicallyLoadedModuleNames.AddRange(
new string[]
{
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);

if (Target.Platform == UnrealTargetPlatform.Android)
{
PrivateDependencyModuleNames.AddRange(new string[] { "Launch" });
string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "Immutable_UPL_Android.xml"));
}
if (Target.Platform == UnrealTargetPlatform.IOS)
{
PrivateDependencyModuleNames.AddRange(new string[]{ "Launch" });
PrivateIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Private", "IOS") });
PublicFrameworks.AddRange(
new string[]
{
"Foundation",
"AuthenticationServices"
}
);
}
if (Target.Platform == UnrealTargetPlatform.Mac)
{
PrivateIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Private", "Mac") });
PublicFrameworks.AddRange(
new string[]
{
"Foundation",
"AuthenticationServices"
}
);
}
}
);

if (Target.Platform == UnrealTargetPlatform.Android)
{
PrivateDependencyModuleNames.AddRange(new string[] { "Launch" });

string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "Immutable_UPL_Android.xml"));
}

if (Target.Platform == UnrealTargetPlatform.IOS)
{
PrivateDependencyModuleNames.AddRange(new string[] { "Launch" });

PrivateIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Private", "IOS") });

PublicFrameworks.AddRange(
new string[]
{
"Foundation",
"AuthenticationServices"
}
);
}

if (Target.Platform == UnrealTargetPlatform.Mac)
{
PrivateIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Private", "Mac") });

PublicFrameworks.AddRange(
new string[]
{
"Foundation",
"AuthenticationServices"
}
);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Fill out your copyright notice in the Description page of Project Settings.


#include "Immutable/Actions/ImtblBlueprintAsyncAction.h"


UImmutableSubsystem* UImtblBlueprintAsyncAction::GetSubsystem() const
{
if (!WorldContextObject || !WorldContextObject->GetWorld())
return nullptr;
return WorldContextObject->GetWorld()->GetGameInstance()->GetSubsystem<UImmutableSubsystem>();
UImmutableSubsystem *UImtblBlueprintAsyncAction::GetSubsystem() const {
if (!WorldContextObject || !WorldContextObject->GetWorld())
return nullptr;
return WorldContextObject->GetWorld()
->GetGameInstance()
->GetSubsystem<UImmutableSubsystem>();
}

Loading

0 comments on commit 94b830a

Please sign in to comment.