Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
PereViader committed Aug 24, 2024
2 parents 261b28c + 2e3fbf5 commit f0c460b
Show file tree
Hide file tree
Showing 185 changed files with 7,751 additions and 1,304 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/PublishNugetPackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ jobs:
with:
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
PROJECT_FILE_PATH: ManualDi.Main/ManualDi.Main.csproj
REBUILD_PROJECT: false
REBUILD_PROJECT: false
TAG_COMMIT: true
TAG_FORMAT: Nuget/*
13 changes: 12 additions & 1 deletion .github/workflows/PublishUnity3dPackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,15 @@ jobs:
tag_name: Unity3d/${{ steps.get-version.outputs.version }}
name: Unity3d ManualDi.Main ${{ steps.get-version.outputs.version }}
files: |
UnityPackageRelease/me.pereviader.manualdi.main-${{ steps.get-version.outputs.version }}.tgz
UnityPackageRelease/me.pereviader.manualdi.main-${{ steps.get-version.outputs.version }}.tgz
- name: Trigger Unity3d Repo Workflow
if: ${{ steps.release-exists.outputs.exists == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run PublishUnity3dPackage.yml \
--repo PereViader/ManualDi.Unity3d \
--ref main \
-f release-tag=Unity3d/${{ steps.get-version.outputs.version }}
-f file-name=me.pereviader.manualdi.main-${{ steps.get-version.outputs.version }}.tgz
16 changes: 16 additions & 0 deletions GenerateUnityPackage/GenerateMainPackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
echo Copy Main folder
cp -r "ManualDi.Main/ManualDi.Main/." "UnityPackageRelease/ManualDi.Main/"

echo Delete unnecesary files from common
rm "UnityPackageRelease/ManualDi.Main/ManualDi.Main.csproj"
rm -rf "UnityPackageRelease/ManualDi.Main/bin"
rm -rf "UnityPackageRelease/ManualDi.Main/obj"
rm -rf "UnityPackageRelease/ManualDi.Main/Properties"

echo Build generator
dotnet build ManualDi.Main --configuration Release

echo Copy generator dll to package
cp "ManualDi.Main/ManualDi.Main.Generators/bin/Release/netstandard2.0/ManualDi.Main.Generators.dll" "UnityPackageRelease/ManualDi.Main.Generators.dll"
cp "GenerateUnityPackage/ManualDi.Main.Generators.dll.meta" "UnityPackageRelease/ManualDi.Main.Generators.dll.meta"
53 changes: 52 additions & 1 deletion GenerateUnityPackage/GeneratePackage.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,57 @@
#!/bin/bash

sh ./GenerateUnityPackage/GenerateUnityPackageReleaseFolder.sh
# Default values for the flags
skip_unity3d=false

# Parse command-line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--skip-unity3d)
skip_unity3d=true
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done

# Path to the .csproj file and package.json
CSPROJ_FILE="ManualDi.Main/ManualDi.Main/ManualDi.Main.csproj"

# Extract version from the .csproj file
version=$(grep -oP '(?<=<Version>)[^<]+' "$CSPROJ_FILE")

# Check if we extracted a version
if [ -z "$version" ]; then
echo "Version not found in $CSPROJ_FILE"
exit 1
fi

echo "Remove previous package"
rm -rf UnityPackageRelease
mkdir -p "UnityPackageRelease/"

echo Copy License
cp "LICENSE.md" "UnityPackageRelease/LICENSE.md"

cp "GenerateUnityPackage\package.json" "UnityPackageRelease\package.json"
echo "Copy package files to the package root"
sed -i "s/\"version\": \"\$version\"/\"version\": \"$version\"/g" "UnityPackageRelease/package.json"
echo "Version in package.json updated to $version"

echo Copy assambly definition
cp "GenerateUnityPackage/ManualDi.asmdef" "UnityPackageRelease/ManualDi.asmdef"
cp "GenerateUnityPackage/ManualDi.asmdef.meta" "UnityPackageRelease/ManualDi.asmdef.meta"
cp "GenerateUnityPackage/csc.rsp" "UnityPackageRelease/csc.rsp"

sh ./GenerateUnityPackage/GenerateMainPackage.sh
if $skip_unity3d; then
echo "Skipping unity3d package"
else
sh ./GenerateUnityPackage/GenerateUnity3dPackage.sh
fi
sh ./GenerateUnityPackage/GenerateUnity3dMetas.sh
cd UnityPackageRelease
npm pack
4 changes: 4 additions & 0 deletions GenerateUnityPackage/GenerateUnity3dPackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
cp -r "ManualDi.Unity3d/Assets/ManualDi.Unity3d/." "UnityPackageRelease/ManualDi.Unity3d/"
mv "UnityPackageRelease/ManualDi.Unity3d/Samples" "UnityPackageRelease/ManualDi.Unity3d/Samples~"
rm "UnityPackageRelease/ManualDi.Unity3d/Samples.meta"
50 changes: 0 additions & 50 deletions GenerateUnityPackage/GenerateUnityPackageReleaseFolder.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": true
"noEngineReferences": false
}
File renamed without changes.
25 changes: 18 additions & 7 deletions GenerateUnityPackage/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
{
"name": "me.pereviader.manualdi.main",
"name": "com.pereviader.manualdi.unity3d",
"version": "$version",
"displayName": "ManualDi.Main",
"description": "A C# dependency injection library without reflection",
"unity": "2022.3.33",
"displayName": "ManualDi",
"description": "Fast C# dependency injection library that uses no reflexion",
"unity": "2022.3",
"license": "MIT",
"documentationUrl": "https://github.com/PereViader/ManualDi.Main",
"dependencies": {
}
}
"changelogUrl": "https://github.com/PereViader/ManualDi.Main/commits/main/",
"licensesUrl": "https://opensource.org/license/mit",
"author": {
"name": "Pere Viader",
"url": "https://github.com/PereViader"
},
"samples": [
{
"displayName": "Samples",
"description": "Samples for ManualDi",
"path": "ManualDi.Unity3d/Samples~"
}
]
}
62 changes: 0 additions & 62 deletions ManualDi.Main.Tests/TestDiContainerNonGenericResolve.cs

This file was deleted.

38 changes: 0 additions & 38 deletions ManualDi.Main.Tests/TestDiContainerNonGenericResolveAll.cs

This file was deleted.

50 changes: 0 additions & 50 deletions ManualDi.Main.Tests/TestDiContianerTryResolve.cs

This file was deleted.

13 changes: 13 additions & 0 deletions ManualDi.Main/.idea/.idea.ManualDi/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ManualDi.Main/.idea/.idea.ManualDi/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ManualDi.Main/.idea/.idea.ManualDi/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions ManualDi.Main/.idea/.idea.ManualDi/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f0c460b

Please sign in to comment.