Editor config for Unity3d packages and/or projects
The main idea is to attach this project to your and use symlinks to have .editorconfig
at a
correct place.
The project contains two branches that can be used in other projects.
These are pure
and main
.
pure
contains .editorconfig
file only
main
contains full package files set.
If you develop a custom unity3d package
it's best to use pure
branch
to avoid GUID conflicts if a package user has other packages dependent on this one.
If you work on a final product you can use both branches. But it's recommended to attach this project as a unity3d package and aim your symlinks to a copy of the package in the Library/PackageCache directory.
Btw, to create a symlink use the following command template
ln -s source_file symbolic_link
For example, if you attached this editorconfig as a package
and you want to use the .editorconfig
file as a config to the whole project
then the command may look like this
cd my-project-root-path
ln -s Library/PackageCache/fedorenkosergiy.grabli.editorconfig@636ebb2/.editorconfig .editorconfig
If you use git as a VCS you can use submodules approach to attach this project to your.
The best place to put the submodule at is somewhere out of Assets and Packages directory to avoid unnecessary importing by unity.
Use following commands to attach this project as a submodule.
Replace my-parent-directory-path
with your path and branch-name
with the branch name you prefer.
cd my-parent-directory-path
git submodule add git@github.com:fedorenkosergiy/Grabli.EditorConfig.git
cd Grabli.EditorConfig
git checkout branch-name
Select the version of the package you prefer. It's best to use static references like exact commits and tags. The less reliable approach is to use a reference to a branch name or the head. But if you're aware of possible issues I have no power to stop you 😉
The next step is combining the package source URL and the version marker.
For example,
if you want to use version v0.0.1
it would be this line you need
https://github.com/fedorenkosergiy/Grabli.EditorConfig.git#v0.0.1
One more example.
If you want to use commit
636ebb221b51032fc328157f86af6f7f722feaea
it would be this line you need
https://github.com/fedorenkosergiy/Grabli.EditorConfig.git#636ebb221b51032fc328157f86af6f7f722feaea
So, now when you have a pointer to the version you need it's time to attach the package to your project.
Open Packages/manifest.json
file.
Add there following line among other similar lines
"fedorenkosergiy.grabli.editorconfig": "https://github.com/fedorenkosergiy/Grabli.EditorConfig.git#version-marker",
Here is an example
...
"com.unity.2d.sprite": "1.0.0",
"fedorenkosergiy.grabli.editorconfig": "https://github.com/fedorenkosergiy/Grabli.EditorConfig.git#v0.0.1",
"com.unity.2d.tilemap": "1.0.0",
...
As an option you can also use package manager window to add the package manually
There is no way for now. But I'm thinking of that