Переглянути джерело

release 0.2.0: security release, API unchanged at 0.1

- MANIFEST 0.1 -> 0.2.0 for the goal/security release.
- split api_version ('0.1' — library/vapi/gir/pc artifact names, every
  downstream consumer depends on them) from release_version (project
  version, reaching only the pkg-config Version: field, which usm
  validates against the manifest version).
- pin the current inversion-0.1.vapi (Scope.release, inversion f66ed87)
  in vapi/ — the system vapi on older hosts predates the API and the
  goal/security request-scope lifecycle (Pipeline.release) needs it.
clanker 4 тижнів тому
батько
коміт
2a1e0875ae
4 змінених файлів з 173 додано та 30 видалено
  1. 23 21
      MANIFEST.usm
  2. 1 1
      meson.build
  3. 13 8
      src/meson.build
  4. 136 0
      vapi/inversion-0.1.vapi

+ 23 - 21
MANIFEST.usm

@@ -1,19 +1,21 @@
 {
-  "name": "astralis",
-  "version": "0.1",
-  "summary": "Library for writing HTTP backends",
-  "licences": [],
-  "flags": ["ninjaStyleProgress"],
-  "provides": {
-    "lib:libastralis-0.1.so": "as-expected",
-    "inc:astralis-0.1.h": "as-expected",
-    "vapi:astralis-0.1.vapi": "as-expected",
-    "gir:astralis-0.1.gir": "as-expected",
-    "typelib:libastralis-0.1.typelib": "as-expected",
-    "pc:astralis-0.1.pc": "as-expected"
+  "name" : "astralis",
+  "version" : "0.2.0",
+  "summary" : "Library for writing HTTP backends",
+  "licences" : [],
+  "flags" : [
+    "ninjaStyleProgress"
+  ],
+  "provides" : {
+    "lib:libastralis-0.1.so" : "as-expected",
+    "inc:astralis-0.1.h" : "as-expected",
+    "vapi:astralis-0.1.vapi" : "as-expected",
+    "gir:astralis-0.1.gir" : "as-expected",
+    "typelib:libastralis-0.1.typelib" : "as-expected",
+    "pc:astralis-0.1.pc" : "as-expected"
   },
-  "depends": {
-    "runtime": [
+  "depends" : {
+    "runtime" : [
       "lib:libglib-2.0.so.0",
       "lib:libgobject-2.0.so.0",
       "lib:libgio-2.0.so.0",
@@ -26,7 +28,7 @@
       "lib:libbrotlienc.so.1",
       "lib:libzstd.so.1"
     ],
-    "build": [
+    "build" : [
       "bin:valac",
       "bin:meson",
       "bin:ninja",
@@ -46,13 +48,13 @@
       "pc:invercargill-json.pc",
       "pc:inversion-0.1.pc"
     ],
-    "manage": [
+    "manage" : [
       "bin:bash"
     ]
   },
-  "execs": {
-    "build": "usm-scripts/build.sh",
-    "install": "usm-scripts/install.sh",
-    "postInstall": "usm-scripts/post-install.sh"
+  "execs" : {
+    "build" : "usm-scripts/build.sh",
+    "install" : "usm-scripts/install.sh",
+    "postInstall" : "usm-scripts/post-install.sh"
   }
-}
+}

+ 1 - 1
meson.build

@@ -1,5 +1,5 @@
 project('astralis', ['c', 'vala'],
-  version: '0.1',
+  version: '0.2.0',
 )
 
 # Dependencies

+ 13 - 8
src/meson.build

@@ -38,24 +38,29 @@ sources = files(
 )
 
 
-library_version = meson.project_version()
-libastralis = shared_library('astralis-@0@'.format(library_version),
+# The API version rides every artifact name (libastralis-0.1.so,
+# astralis-0.1.vapi, ...); the project version is the release version and
+# only reaches the pkg-config Version: field (usm checks it against the
+# manifest version).
+api_version = '0.1'
+release_version = meson.project_version()
+libastralis = shared_library('astralis-@0@'.format(api_version),
     sources,
     dependencies: [glib_dep, gobject_dep, mhd_dep, gio_dep, gio_unix_dep, invercargill_dep, invercargill_json_dep, json_glib_dep, zlib_dep, brotli_dep, zstd_dep, inversion_dep, libxml_dep],
     install: true,
-    vala_gir: 'astralis-@0@.gir'.format(library_version),
+    vala_gir: 'astralis-@0@.gir'.format(api_version),
     install_dir: [true, true, true, true]
 )
 
 
 pkg = import('pkgconfig')
 pkg.generate(libastralis,
-    version : library_version,
-    name : 'astralis-@0@'.format(library_version))
-    
+    version : release_version,
+    name : 'astralis-@0@'.format(api_version))
+
 g_ir_compiler = find_program('g-ir-compiler')
-custom_target('astralis typelib', command: [g_ir_compiler, '--shared-library=libastralis-@0@.so'.format(library_version), '--output', '@OUTPUT@', meson.current_build_dir() / 'astralis-@0@.gir'.format(library_version)],
-              output: 'libastralis-@0@.typelib'.format(library_version),
+custom_target('astralis typelib', command: [g_ir_compiler, '--shared-library=libastralis-@0@.so'.format(api_version), '--output', '@OUTPUT@', meson.current_build_dir() / 'astralis-@0@.gir'.format(api_version)],
+              output: 'libastralis-@0@.typelib'.format(api_version),
               depends: libastralis,
               install: true,
               install_dir: get_option('libdir') / 'girepository-1.0')

+ 136 - 0
vapi/inversion-0.1.vapi

@@ -0,0 +1,136 @@
+/* inversion-0.1.vapi generated by valac 0.56.19, do not modify. */
+
+[CCode (gir_namespace = "inversion", gir_version = "0.1")]
+namespace Inversion {
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public class Container : GLib.Object {
+		public Container ();
+		public T configure_with<T> () throws GLib.Error;
+		public Inversion.Scope create_scope ();
+		public Inversion.Scope create_transient_scope ();
+		public Invercargill.Enumerable<Inversion.Registration> get_all_registrations ();
+		public Inversion.Registration get_registration (GLib.Type service_type) throws Inversion.ContainerError;
+		public Invercargill.Enumerable<Inversion.Registration> get_registrations (GLib.Type service_type);
+		public void initialise () throws GLib.Error;
+		public bool is_registered (GLib.Type type);
+		public Inversion.Registration register<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func, Inversion.Lifecycle lifecycle);
+		public Inversion.Registration register_factory<T> (Inversion.Factory factory, Inversion.Lifecycle lifecycle);
+		public Inversion.Registration register_factory_type (GLib.Type implementation_type, Inversion.Factory factory, Inversion.Lifecycle lifecycle);
+		public Inversion.Registration register_module<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null) throws GLib.Error;
+		public Inversion.Registration register_module_factory_type (GLib.Type type, Inversion.Factory factory) throws GLib.Error;
+		public Inversion.Registration register_module_type (GLib.Type type, owned Inversion.FactoryDelegate? factory_func = null) throws GLib.Error;
+		public Inversion.Registration register_scoped<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
+		public Inversion.Registration register_singleton<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
+		public Inversion.Registration register_startup<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
+		public Inversion.Registration register_transient<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
+		public Inversion.Registration register_type (GLib.Type implementation_type, owned Inversion.FactoryDelegate? factory_func, Inversion.Lifecycle lifecycle);
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public class DelegateFactory : GLib.Object, Inversion.Factory {
+		public DelegateFactory (owned Inversion.FactoryDelegate @delegate);
+		public static Inversion.DelegateFactory typed<T> (owned Inversion.TypedFactoryDelegate<T> @delegate);
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public class InjectionContext {
+		public InjectionContext (Inversion.Scope scope, GLib.Type requested_type, Inversion.Registration registration, Inversion.InjectionContext? previous = null);
+		public GLib.Error? error { get; set; }
+		public Inversion.InjectionContext? previous_context { get; set; }
+		public Inversion.Registration registration { get; set; }
+		public GLib.Type requested_type { get; set; }
+		public Inversion.Scope scope { get; set; }
+		public Invercargill.DataStructures.HashSet<Inversion.Registration> stack_registrations { get; set; }
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public class InstanceFactory : GLib.Object, Inversion.Factory {
+		public InstanceFactory (Inversion.Registration registration, GLib.Object instance);
+		public Inversion.Registration registration { get; set construct; }
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public class ObjectFactory : GLib.Object, Inversion.Factory {
+		public ObjectFactory (GLib.Type instance_type);
+		public GLib.Type instance_type { get; construct; }
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public class Registration : GLib.Object {
+		public Registration (GLib.Type implementation_type, Inversion.Factory factory, Inversion.Lifecycle lifecycle);
+		public Inversion.Registration @as<T> ();
+		public Inversion.Registration as_type (GLib.Type type);
+		public Invercargill.Enumerable<T> get_metadata<T> ();
+		public Invercargill.Enumerable<GLib.Object> get_metadata_type (GLib.Type type);
+		public bool provides (GLib.Type type);
+		public Inversion.Registration with_metadata<T> (T metadata);
+		public Inversion.Registration with_metadata_type (GLib.Type type, GLib.Object metadata);
+		public Inversion.Factory factory { get; set construct; }
+		public GLib.Type implementation_type { get; set construct; }
+		public Inversion.Lifecycle lifecycle { get; set construct; }
+		public Invercargill.ImmutableLot<GLib.Type> type_aliases { get; private set; }
+		public signal void alias_added (GLib.Type alias);
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public class Scope : GLib.Object {
+		public Invercargill.Enumerable<Inversion.Registration> get_all_registrations ();
+		public Invercargill.Enumerable<Inversion.Registration> get_local_registrations (GLib.Type service_type);
+		public Inversion.Registration get_registration (GLib.Type service_type) throws Inversion.ContainerError;
+		public Invercargill.Enumerable<Inversion.Registration> get_registrations (GLib.Type service_type);
+		public bool is_locally_registered (GLib.Type type);
+		public bool is_registered (GLib.Type type);
+		public Inversion.Registration register_local<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null, Inversion.Lifecycle lifecycle = Lifecycle.SCOPED);
+		public Inversion.Registration register_local_factory<T> (Inversion.Factory factory, Inversion.Lifecycle lifecycle);
+		public Inversion.Registration register_local_factory_type (GLib.Type implementation_type, Inversion.Factory factory, Inversion.Lifecycle lifecycle);
+		public Inversion.Registration register_local_scoped<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
+		public Inversion.Registration register_local_transient<T> (owned Inversion.TypedFactoryDelegate<T>? factory_func = null);
+		public Inversion.Registration register_local_type (GLib.Type implementation_type, owned Inversion.FactoryDelegate? factory_func, Inversion.Lifecycle lifecycle);
+		public void release ();
+		public T resolve<T> () throws GLib.Error;
+		public Invercargill.Enumerable<T> resolve_all<T> () throws GLib.Error;
+		public Invercargill.Enumerable<GLib.Object> resolve_all_type (GLib.Type type) throws GLib.Error;
+		public GLib.Object resolve_registration (Inversion.Registration registration) throws GLib.Error;
+		public GLib.Object resolve_type (GLib.Type type) throws GLib.Error;
+		public Inversion.Container container { get; set construct; }
+		public Inversion.Lifecycle scope_lifecycle { get; set construct; }
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public interface Factory : GLib.Object {
+		public abstract GLib.Object create (Inversion.Scope scope) throws GLib.Error;
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public interface Module : GLib.Object {
+		public abstract void register_components (Inversion.Container container) throws GLib.Error;
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public enum Lifecycle {
+		TRANSIENT,
+		SCOPED,
+		SINGLETON,
+		STARTUP
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public errordomain ContainerError {
+		NOT_REGISTERED,
+		CYCLE_DETECTED,
+		ILLEGAL_LIFECYCLE_COMBINATION,
+		INCOMPATIBLE_TYPE
+	}
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public delegate GLib.Object FactoryDelegate (Inversion.Scope scope) throws GLib.Error;
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public delegate T TypedFactoryDelegate<T> (Inversion.Scope scope) throws GLib.Error;
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public static GLib.Object create_with_injection_context (Inversion.Scope scope, GLib.Type requested_type, Inversion.Registration registration) throws GLib.Error;
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public static Inversion.InjectionContext enter_new_injection_context (Inversion.Scope scope, GLib.Type requested_type, Inversion.Registration registration) throws GLib.Error;
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public static void exit_injection_context () throws GLib.Error;
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public static Inversion.InjectionContext get_injection_context ();
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public static T inject<T> ();
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public static Invercargill.Lot<T> inject_all<T> ();
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public static Inversion.InjectionContext? try_get_injection_context ();
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public static T try_inject<T> ();
+	[CCode (cheader_filename = "inversion-0.1.h")]
+	public static Invercargill.Lot<T> try_inject_all<T> ();
+}