Skip to content

Commit

Permalink
Merge pull request #1 from Varollo/package-export-script
Browse files Browse the repository at this point in the history
Package export script
  • Loading branch information
Varollo authored Aug 13, 2024
2 parents 5c96a57 + 1cf3078 commit 213dbcc
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 57 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ bld/
[Oo]bj/
[Ll]og/
[Ll]ogs/
[Ee]xport/

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,29 @@ I should also say that I do not own the rights to **Aseprite** itself. You can f

---------------------------------------------

## Requirements
## Package Installation

The only requirement, is the [Json.Net](https://www.newtonsoft.com/json) library, by [Newtonsoft](https://www.newtonsoft.com/).
### Core Library

Furthermore, if you use [MonoGame](https://monogame.net/), there's an optional **assembly** with a *ready-to-use* **animation system**.
Open your terminal of choice and paste the following command:

```shell
dotnet add package AsepriteImporter
```

> More details and installation methods on the [Core Library Wiki Page](https://github.com/Varollo/aseprite-importer/wiki/Core-Library#1-installation-process).
### MonoGame Module

Open your terminal of choice and paste the following command:

```shell
dotnet add package AsepriteImporter.MG
```

> More details and installation methods on the [MonoGame Module Wiki Page](https://github.com/Varollo/aseprite-importer/wiki/MonoGame-Module#1-installation-process).
***

## Guides and Documentation

Expand Down
24 changes: 24 additions & 0 deletions Resources/Package/Common/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Aseprite Importer

**Aseprite Importer** is a **.Net** and **MonoGame** library to load the *JSON* data generated by the *pixel art* software **Aseprite**, when exporting a sprite sheet.

I should also say that I do not own the rights to **Aseprite** itself. You can find the program on their [website](https://www.aseprite.org/).

## Guides and Documentation

You can find **Guides** and _auto-generated_ **Documentation** in the [wiki](https://github.com/Varollo/aseprite-importer/wiki) section of the [GitHub Repository](https://github.com/Varollo/aseprite-importer).

Here are some useful pages to get started:

- **ASEPRITE:**
- [Exporting a Sprite Sheet on Aseprite](https://github.com/Varollo/aseprite-importer/wiki/Aseprite)

- **CORE LIBRARY:**
- [Core Library Installation](https://github.com/Varollo/aseprite-importer/wiki/Core-Library#1-installation-process)
- [Core Library Usage](https://github.com/Varollo/aseprite-importer/wiki/Core-Library#2-loading-the-sprite-sheet-data)
- [Core Library Documentation](https://github.com/Varollo/aseprite-importer/wiki/varollo.asepriteimporter.index)

- **MONOGAME MODULE:**
- [MonoGame Module Installation](https://github.com/Varollo/aseprite-importer/wiki/MonoGame-Module#1-installation-process)
- [MonoGame Module Usage](https://github.com/Varollo/aseprite-importer/wiki/MonoGame-Module#2-animating-with-the-asepriteanimator)
- [MonoGame Module Documentation](https://github.com/Varollo/aseprite-importer/wiki/varollo.asepriteimporter.mg.index)
Binary file added Resources/Package/Core/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/Package/MonoGame/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 28 additions & 24 deletions Source/Core/AsepriteImporter/AsepriteImporter.csproj
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<!--[ Configuration ]-->
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="call postbuild.bat $(TargetDir) $(AssemblyName)" WorkingDirectory="$(SolutionDir)" />
</Target>

<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<!--[ Dependencies ]-->
<ItemGroup>
<None Include="$(SolutionDir)/README.md" Pack="true" PackagePath="\" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<!--[ Package MetaData ]-->
<PropertyGroup>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<PackageVersion>1.0.1</PackageVersion>
<Title>Aseprite Importer</Title>

<Authors>Varollo</Authors>
<RepositoryUrl>https://github.com/Varollo/aseprite-importer</RepositoryUrl>

<PackageTags>
.Net;Json;Aseprite;PixelArt;Pixel;Art
</PackageTags>

<Description>
Aseprite Importer is a .Net Standard 2.1 library to load the Json data
generated by the pixel-art software Aseprite, when exporting a sprite sheet.
</Description>

<PackageIconUrl>icon</PackageIconUrl>
<PackageLicenseUrl>LICENSE</PackageLicenseUrl>
<PackageReadmeUrl>readme</PackageReadmeUrl>
</PropertyGroup>

<!--[ Package Resources ]-->
<ItemGroup>
<None Include="$(SolutionDir)\Resources\Package\Common\readme.md" Pack="true" PackagePath="\" />
<None Include="$(SolutionDir)\Resources\Package\Core\icon.png" Pack="true" PackagePath="\" />
<None Include="$(SolutionDir)\LICENSE.txt" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

</Project>
52 changes: 28 additions & 24 deletions Source/MonoGame/AsepriteImporter.MG/AsepriteImporter.MG.csproj
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--[ Configuration ]-->
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>

<!--[ Dependencies ]-->
<ItemGroup>
<ProjectReference Include="..\..\Core\AsepriteImporter\AsepriteImporter.csproj" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\AsepriteImporter\AsepriteImporter.csproj" />
</ItemGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<!--[ Package MetaData ]-->
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="call postbuild.bat $(TargetDir) $(AssemblyName)" WorkingDirectory="$(SolutionDir)" />
</Target>

<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PackageVersion>1.0.1</PackageVersion>
<Title>Aseprite Importer - MonoGame Module</Title>

<Authors>Varollo</Authors>
<RepositoryUrl>https://github.com/Varollo/aseprite-importer</RepositoryUrl>

<PackageTags>
.Net;MonoGame;Json;Aseprite;PixelArt;Pixel;Art
</PackageTags>

<ItemGroup>
<None Include="$(SolutionDir)/README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<Description>
Aseprite Importer is a .Net Standard 2.1 library to load the Json data
generated by the pixel-art software Aseprite, when exporting a sprite sheet.
</Description>

<PropertyGroup>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<PackageIconUrl>icon</PackageIconUrl>
<PackageLicenseUrl>LICENSE</PackageLicenseUrl>
<PackageReadmeUrl>readme</PackageReadmeUrl>
</PropertyGroup>


<!--[ Package Resources ]-->
<ItemGroup>
<None Include="$(SolutionDir)\Resources\Package\Common\readme.md" Pack="true" PackagePath="\" />
<None Include="$(SolutionDir)\Resources\Package\MonoGame\icon.png" Pack="true" PackagePath="\" />
<None Include="$(SolutionDir)\LICENSE.txt" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
31 changes: 31 additions & 0 deletions export.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@echo off

SET "o=%1"
IF "%1"=="" SET "o=Export"
ECHO "Exporting packages to '.\%o%'"

CALL :Build "AsepriteImporter" "Source\Core\AsepriteImporter" %o%
CALL :Pack "AsepriteImporter" "Source\Core\AsepriteImporter" %o%

CALL :Build "AsepriteImporter.MG" "Source\MonoGame\AsepriteImporter.MG" %o%
CALL :Pack "AsepriteImporter.MG" "Source\MonoGame\AsepriteImporter.MG" %o%

ECHO "> [ DONE! ] Press any key to continue..."
PAUSE

CALL explorer.exe "%o%"
EXIT /B %ERRORLEVEL%

@REM 1: ProjName; 2: ProjDir; 3: OutputDir
:Build
ECHO "> [ BUILD ] Building project '%~1'..."
CALL dotnet build "%~2\%~1.csproj" --output "%~3\%~1\Lib"
ECHO "> [ DOCS ] Documenting project '%~1'..."
CALL xmldoc2md "%~3\%~1\Lib\%~1.dll" --output "%~3\%~1\Docs" --gitlab-wiki --back-button
EXIT /B 0

@REM 1: ProjName; 2: ProjDir; 3: OutputDir
:Pack
ECHO "> [ PACKN ] Packing project '%~1'..."
CALL dotnet pack "%~2\%~1.csproj" --output "%~3\%~1"
EXIT /B 0
6 changes: 0 additions & 6 deletions postbuild.bat

This file was deleted.

0 comments on commit 213dbcc

Please sign in to comment.