Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Pico -> Inject / Injection #7174

Merged
merged 5 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 21 additions & 21 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1388,56 +1388,56 @@
<version>${helidon.version}</version>
</dependency>

<!-- Pico Core -->
<!-- Injection Core -->
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-api</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-api</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-tools</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-tools</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-processor</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-processor</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-maven-plugin</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-maven-plugin</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-testing</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-testing</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-runtime</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-runtime</artifactId>
<version>${helidon.version}</version>
</dependency>

<!-- Pico Config-Driven related -->
<!-- Injection Config-Driven related -->
<dependency>
<groupId>io.helidon.pico.configdriven</groupId>
<artifactId>helidon-pico-configdriven-api</artifactId>
<groupId>io.helidon.inject.configdriven</groupId>
<artifactId>helidon-inject-configdriven-api</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.pico.configdriven</groupId>
<artifactId>helidon-pico-configdriven-runtime</artifactId>
<groupId>io.helidon.inject.configdriven</groupId>
<artifactId>helidon-inject-configdriven-runtime</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.pico.configdriven</groupId>
<artifactId>helidon-pico-configdriven-processor</artifactId>
<groupId>io.helidon.inject.configdriven</groupId>
<artifactId>helidon-inject-configdriven-processor</artifactId>
<version>${helidon.version}</version>
</dependency>

<!-- Pico Integrations related -->
<!-- Injection Integrations related -->
<dependency>
<groupId>io.helidon.integrations.oci.sdk</groupId>
<artifactId>helidon-integrations-oci-sdk-processor</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static String createString(TypeName generator,
.toString();
}

// @Generated(value = "io.helidon.pico.tools.ActivatorCreatorDefault", comments = "version=1")
// @Generated(value = "io.helidon.inject.tools.ActivatorCreatorDefault", comments = "version=1")
private static class DefaultProvider implements GeneratedAnnotationProvider {
private static final TypeName GENERATED = TypeName.create("io.helidon.common.Generated");

Expand Down
16 changes: 8 additions & 8 deletions config/config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
<artifactId>helidon-logging-jul</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-api</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-api</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-runtime</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-runtime</artifactId>
<optional>true</optional>
</dependency>
<dependency>
Expand Down Expand Up @@ -127,8 +127,8 @@
<version>${helidon.version}</version>
</path>
<path>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-processor</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-processor</artifactId>
<version>${helidon.version}</version>
</path>
</annotationProcessorPaths>
Expand All @@ -142,8 +142,8 @@
</dependency>
<dependency>
<!-- this is required to add the processor to reactor at the right time -->
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-processor</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-processor</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.helidon.common.config.ConfigValue;
import io.helidon.common.config.GlobalConfig;
import io.helidon.config.spi.ConfigSource;
import io.helidon.pico.api.ExternalContracts;
import io.helidon.inject.api.ExternalContracts;

import jakarta.inject.Inject;
import jakarta.inject.Provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import io.helidon.config.Config;
import io.helidon.config.ConfigSources;
import io.helidon.pico.api.Contract;
import io.helidon.inject.api.Contract;

/**
* {@link Source} of configuration.
Expand Down
8 changes: 4 additions & 4 deletions config/config/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
requires transitive io.helidon.common;
requires transitive io.helidon.common.media.type;

requires io.helidon.pico.api;
requires io.helidon.inject.api;

requires static io.helidon.common.features.api;
requires static io.helidon.pico.runtime;
requires static io.helidon.inject.runtime;
requires static jakarta.inject;


Expand All @@ -57,8 +57,8 @@
with io.helidon.config.PropertiesConfigParser;
provides io.helidon.common.config.spi.ConfigProvider
with io.helidon.config.HelidonConfigProvider;
provides io.helidon.pico.api.ModuleComponent
with io.helidon.config.Pico$$Module;
provides io.helidon.inject.api.ModuleComponent
with io.helidon.config.Injection$$Module;

// needed when running with modules - to make private methods accessible
opens io.helidon.config to weld.core.impl, io.helidon.microprofile.cdi;
Expand Down
12 changes: 6 additions & 6 deletions config/tests/service-registry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
<artifactId>jakarta.inject-api</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-runtime</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-runtime</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-yaml</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-testing</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-testing</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -72,8 +72,8 @@
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-processor</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-processor</artifactId>
<version>${helidon.version}</version>
</path>
</annotationProcessorPaths>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

import io.helidon.common.config.Config;
import io.helidon.common.config.GlobalConfig;
import io.helidon.pico.api.Bootstrap;
import io.helidon.pico.api.PicoServices;
import io.helidon.pico.testing.PicoTestingSupport;
import io.helidon.inject.api.Bootstrap;
import io.helidon.inject.api.InjectionServices;
import io.helidon.inject.testing.InjectionTestingSupport;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.MethodOrderer;
Expand All @@ -37,18 +37,18 @@
class ConfigProducerTest {
@AfterEach
void reset() {
PicoTestingSupport.resetAll();
InjectionTestingSupport.resetAll();
}

@Test
@Order(0) // this must be first, as once we set global config, this method will always fail
void testConfig() {
PicoServices.globalBootstrap(Bootstrap.builder()
InjectionServices.globalBootstrap(Bootstrap.builder()
.config(GlobalConfig.config())
.build());

// value should be overridden using our custom config source
Config config = PicoServices.realizedServices()
Config config = InjectionServices.realizedServices()
.lookup(Config.class)
.get();

Expand All @@ -61,11 +61,11 @@ void testExplicitConfig() {
// value should use the config as we provided it
GlobalConfig.config(io.helidon.config.Config::create, true);

PicoServices.globalBootstrap(Bootstrap.builder()
InjectionServices.globalBootstrap(Bootstrap.builder()
.config(GlobalConfig.config())
.build());

Config config = PicoServices.realizedServices()
Config config = InjectionServices.realizedServices()
.lookup(Config.class)
.get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import io.helidon.config.spi.ConfigNode;
import io.helidon.config.spi.ConfigSource;
import io.helidon.config.spi.NodeConfigSource;
import io.helidon.pico.api.ExternalContracts;
import io.helidon.inject.api.ExternalContracts;

import jakarta.inject.Singleton;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
app.value: "file"

# needed to reset state of service registry in test
pico:
inject:
permits-dynamic: true
service-lookup-caching: true
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

///////////////////////////////////////////////////////////////////////////////

= Helidon Pico
:description: about Helidon Pico
:keywords: helidon, java, microservices, reactive, virtual threads
= Helidon Injection
:description: about Helidon Injection
:keywords: helidon, inject, injection, java, microservices, reactive, virtual threads



Expand All @@ -36,63 +36,63 @@

== Overview

Helidon Pico //explain what it is and what it can do.
Helidon Injection //explain what it is and what it can do.

== Maven Coordinates

To enable Pico add the following dependencies to your project's `pom.xml` (see Managing Dependencies).
To enable Injection add the following dependencies to your project's `pom.xml` (see Managing Dependencies).

.Pico dependencies
.Injection dependencies
[source,java]

----
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-api</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-api</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.pico</groupId>
<artifactId>helidon-pico-types</artifactId>
<groupId>io.helidon.inject</groupId>
<artifactId>helidon-inject-types</artifactId>
<version>${helidon.version}</version>
</dependency>
----

== Usage

Once you have planned how each of your resources should support Pico, you specify the Pico behavior in one of two ways:
Once you have planned how each of your resources should support Injection, you specify the behavior in one of two ways:



== API

Adding Pico behavior to your Helidon Níma application involves just a few simple steps.
Adding Ijection behavior to your Helidon Níma application involves just a few simple steps.

=== Maven Coordinates

.Pico API pom.xml
.Injection API pom.xml
[source, java]
----
<artifactId>helidon-pico-api</artifactId>
<name>Helidon Pico API</name>
<artifactId>helidon-inject-inject</artifactId>
<name>Helidon Injection API</name>
----


=== Types

The Pico API provides types that are generally useful at compile time to assign special meaning to the type. In this way it also helps with readability and intentions of the code itself.
The Injection API provides types that are generally useful at compile time to assign special meaning to the type. In this way it also helps with readability and intentions of the code itself.

.Pico types pom.xml
.Injection types pom.xml
[source, java]
----
<artifactId>helidon-pico-types</artifactId>
<name>Helidon Pico Types</name>
<artifactId>helidon-inject-types</artifactId>
<name>Helidon Injection Types</name>
----


* {@link io.helidon.pico.api.Contract} - signifies that the type can be used for lookup in the service registry.
* {@link io.helidon.pico.api.ExternalContracts} - same as Contract, but applied to the implementation class instead.
* {@link io.helidon.pico.api.RunLevel} - ascribes meaning for when the service should start.
* {@link io.helidon.inject.api.Contract} - signifies that the type can be used for lookup in the service registry.
* {@link io.helidon.inject.api.ExternalContracts} - same as Contract, but applied to the implementation class instead.
* {@link io.helidon.inject.api.RunLevel} - ascribes meaning for when the service should start.



Expand All @@ -101,16 +101,12 @@ The Pico API provides types that are generally useful at compile time to assign

== Configuration

Pico Config builder
Injection Config builder



== Examples

//optional
//optional

== Additional Information




Loading