Skip to content
Merged
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
38 changes: 31 additions & 7 deletions .github/scripts/validate-unity-distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

ROOT = Path(__file__).resolve().parents[2]
DEMO = ROOT / "examples/demo"
DEMO_PROJECTS = (DEMO, ROOT / "examples/demo-no-location")
BOOTSTRAP = ROOT / "examples/demo/Assets/OneSignal"
SAMPLE = ROOT / "com.onesignal.unitysdk.core/Samples~"
INVENTORY = BOOTSTRAP / "Editor/Resources/OneSignalFileInventory.asset"
Expand All @@ -17,6 +18,9 @@
"com.onesignal.unitysdk.ios",
)
CORE_PACKAGE = PACKAGE_NAMES[0]
PLATFORM_PACKAGES = PACKAGE_NAMES[1:]
EDM_PACKAGE = "com.unity.external-dependency-manager"
EDM_VERSION = "2.0.0"
MINIMUM_UNITY_VERSION = "2022.3"
MINIMUM_UNITY_RELEASE = "0f1"

Expand Down Expand Up @@ -103,13 +107,23 @@ def validate_packages() -> None:
if package.get("samples"):
fail(f"{name} must not contain samples")

manifest = json.loads((DEMO / "Packages/manifest.json").read_text())
if manifest.get("scopedRegistries"):
fail("demo requires a scoped registry")
for name in PACKAGE_NAMES:
expected_path = f"file:../../../{name}"
if manifest["dependencies"].get(name) != expected_path:
fail(f"demo does not reference {name} at {expected_path}")
for name in PLATFORM_PACKAGES:
if packages[name].get("dependencies", {}).get(EDM_PACKAGE) != EDM_VERSION:
fail(f"{name} does not depend on {EDM_PACKAGE}@{EDM_VERSION}")

legacy_installer = ROOT / CORE_PACKAGE / "Editor/SetupSteps/InstallEdm4uStep.cs"
if legacy_installer.exists():
fail(f"{legacy_installer.relative_to(ROOT)} installs unsupported Google EDM4U")

for project in DEMO_PROJECTS:
project_name = project.relative_to(ROOT)
manifest = json.loads((project / "Packages/manifest.json").read_text())
if manifest.get("scopedRegistries"):
fail(f"{project_name} must not declare a scoped registry")
for name in PACKAGE_NAMES:
expected_path = f"file:../../../{name}"
if manifest["dependencies"].get(name) != expected_path:
fail(f"{project_name} does not reference {name} at {expected_path}")
Comment thread
sherwinski marked this conversation as resolved.


def validate_sample() -> None:
Expand Down Expand Up @@ -152,6 +166,16 @@ def validate_sample() -> None:


def main() -> None:
for project in DEMO_PROJECTS:
legacy_edm = project / "Assets/ExternalDependencyManager"
if legacy_edm.exists():
fail(f"{legacy_edm.relative_to(ROOT)} bundles unsupported Google EDM4U")
settings_path = project / "ProjectSettings/ExternalDependencyManagerSettings.json"
if not settings_path.is_file():
fail(f"{settings_path.relative_to(ROOT)} is missing")
settings = json.loads(settings_path.read_text())
if not settings.get("edmEnabled"):
fail(f"{settings_path.relative_to(ROOT)} does not enable Unity EDM")
if (BOOTSTRAP / "Example").exists() or (BOOTSTRAP / "Example.meta").exists():
fail("empty legacy Asset Store Example path still exists")
if (BOOTSTRAP / "Documentation~").exists():
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ You must generate the appropriate credentials for the platform(s) you are releas
> **Upgrading from 3.x.x to 5.x.x?**</br>
> Please check out our [v3 to v5 migration guide](MIGRATION_GUIDE_v3_to_v5.md).

> **Upgrading to 6.x.x?**</br>
> Version 6 uses [Unity's External Dependency Manager](https://docs.unity3d.com/Packages/com.unity.external-dependency-manager@2.0/manual/get-started-with-edm.html). If your project still contains Google's legacy EDM4U under `Assets/ExternalDependencyManager`, select **Use Unity's External Dependency Manager** when prompted. After confirming that your other plugins support Unity EDM, delete the legacy Assets installation so only one dependency manager remains.

1. Add the OneSignal Unity SDK as an available asset to your account by clicking **Add to My Assets** from [our listing on the Unity Asset Store](https://assetstore.unity.com/packages/add-ons/services/billing/onesignal-sdk-193316).
2. Find the package waiting for you to download by clicking **Open in Unity** from that same page. This will open the Unity Editor and its Package Manager window.
3. Install **OneSignal SDK Android** and/or **OneSignal SDK iOS** from the product. Unity installs **OneSignal SDK Core** automatically as a dependency.
Expand Down
16 changes: 0 additions & 16 deletions com.onesignal.unitysdk.android/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,3 @@ Includes ShortcutBadger:
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


Includes unity-jar-resolver
Copyright (C) 2014 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
3 changes: 2 additions & 1 deletion com.onesignal.unitysdk.android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"unityRelease": "0f1",
"description": "Android platform implementation for the OneSignal Unity SDK, including native dependency resolution and notification resources.",
"dependencies": {
"com.onesignal.unitysdk.core": "6.0.0"
"com.onesignal.unitysdk.core": "6.0.0",
"com.unity.external-dependency-manager": "2.0.0"
},
"keywords": [
"push-notifications",
Expand Down
148 changes: 0 additions & 148 deletions com.onesignal.unitysdk.core/Editor/SetupSteps/InstallEdm4uStep.cs

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions com.onesignal.unitysdk.core/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,3 @@ Includes ShortcutBadger:
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


Includes unity-jar-resolver
Copyright (C) 2014 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
1 change: 0 additions & 1 deletion com.onesignal.unitysdk.ios/Editor/BuildPostProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public class BuildPostProcessor : IPostprocessBuildWithReport
/// <summary>
/// must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's
/// added before "pod install" (50)
/// https://github.com/googlesamples/unity-jar-resolver#appending-text-to-generated-podfile
/// </summary>
public int callbackOrder => 45;

Expand Down
16 changes: 0 additions & 16 deletions com.onesignal.unitysdk.ios/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,3 @@ Includes ShortcutBadger:
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


Includes unity-jar-resolver
Copyright (C) 2014 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
3 changes: 2 additions & 1 deletion com.onesignal.unitysdk.ios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"unityRelease": "0f1",
"description": "iOS platform implementation for the OneSignal Unity SDK, including the native bridge, CocoaPods dependencies, and Xcode post-processing.",
"dependencies": {
"com.onesignal.unitysdk.core": "6.0.0"
"com.onesignal.unitysdk.core": "6.0.0",
"com.unity.external-dependency-manager": "2.0.0"
},
"keywords": [
"push-notifications",
Expand Down
1 change: 1 addition & 0 deletions examples/demo-no-location/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/ProjectSettings/*
!/ProjectSettings/AndroidResolverDependencies.xml
!/ProjectSettings/EditorBuildSettings.asset
!/ProjectSettings/ExternalDependencyManagerSettings.json
!/ProjectSettings/OneSignalSettings.json
!/ProjectSettings/ProjectSettings.asset
!/ProjectSettings/ProjectVersion.txt
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
Loading