applejag / Newtonsoft.Json-for-Unity.Bson

Json.NET BSON adds support for reading and writing BSON to Json.NET
MIT License
1 stars 0 forks source link

Asmdef or precompiled? #1

Open applejag opened 3 years ago

applejag commented 3 years ago

What I want to do

Release the source code in the package and use an .asmdef so it can target any Newtonsoft.Json version.

Main issues

Suggested solution

Do precompiled DLLs, like how the Newtonsoft.Json-for-Unity package does it.

We release the package multiple times under different names. One targeting the latest Newtonsoft.Json version, and other that are locked down to the older versions.

Example:

# Targeting latest major version. As of today, that would be v13.0.x
jillejr.newtonsoft.json-for-unity.bson: v1.0.2

# Targeting specific major versions
jillejr.newtonsoft.json-v10-for-unity.bson: v1.0.2
jillejr.newtonsoft.json-v11-for-unity.bson: v1.0.2
jillejr.newtonsoft.json-v12-for-unity.bson: v1.0.2
jillejr.newtonsoft.json-v13-for-unity.bson: v1.0.2

Having the version specified earlier in the package name does force users to use a different scoped registry if they need to switch version. If this becomes needed, then all other Newtonsoft.Json-for-Unity packages should also get equivalent aliases, so you can access them all from the specific registries. A lot more packages to keep track of, but maybe worth it?

Ex:

# Targeting latest major version. As of today, that would be v13.0.1
jillejr.newtonsoft.json-for-unity: v13.0.102
jillejr.newtonsoft.json-for-unity.bson: v1.0.2
jillejr.newtonsoft.json-for-unity.converters: v1.0.0

# Targeting specific major versions
jillejr.newtonsoft.json-v10-for-unity: v10.0.302
jillejr.newtonsoft.json-v10-for-unity.bson: v1.0.2
jillejr.newtonsoft.json-v10-for-unity.converters: v1.0.0

jillejr.newtonsoft.json-v11-for-unity: v11.0.202
jillejr.newtonsoft.json-v11-for-unity.bson: v1.0.2
jillejr.newtonsoft.json-v11-for-unity.converters: v1.0.0

jillejr.newtonsoft.json-v12-for-unity: v12.0.302
jillejr.newtonsoft.json-v12-for-unity.bson: v1.0.2
jillejr.newtonsoft.json-v12-for-unity.converters: v1.0.0

jillejr.newtonsoft.json-v13-for-unity: v13.0.102
jillejr.newtonsoft.json-v13-for-unity.bson: v1.0.2
jillejr.newtonsoft.json-v13-for-unity.converters: v1.0.0

Yep that seems like the leading concept for now.

Not decided yet

If anyone comes past this and has a suggestion, then please tell!

applejag commented 3 years ago

Also, I probably want to do something with a custom patch part of the version, like I've done with Newtonsoft.Json-for-Unity, so for Bson v1.0.2 I use v1.0.2xx, leading to v1.0.201, v1.0.202, v1.0.203, etc for my internal releases and bugfixes.