Skip to content

Commit

Permalink
compile stereotypes on activators (#3007)
Browse files Browse the repository at this point in the history
* properly compile stereotypes on activators

* Add dependencies

* Add dependencies

* Add dependencies
  • Loading branch information
Yasirmod17 authored Aug 7, 2024
1 parent 9a09b72 commit b3e9cd5
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-m3-core</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-runtime-java-engine-compiled</artifactId>
</dependency>

<!-- PURE -->

<!-- ENGINE -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.eclipse.collections.api.factory.Lists;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.impl.utility.ListIterate;
import org.finos.legend.engine.code.core.CoreFunctionActivatorCodeRepositoryProvider;
import org.finos.legend.engine.language.pure.compiler.toPureGraph.CompileContext;
import org.finos.legend.engine.language.pure.compiler.toPureGraph.extension.CompilerExtension;
Expand Down Expand Up @@ -72,6 +73,8 @@ public Root_meta_external_function_activator_bigQueryFunction_BigQueryFunction b
bigQueryFunction.name,
null,
context.pureModel.getClass("meta::external::function::activator::bigQueryFunction::BigQueryFunction"))
._stereotypes(ListIterate.collect(bigQueryFunction.stereotypes, s -> context.resolveStereotype(s.profile, s.value, s.profileSourceInformation, s.sourceInformation)))
._taggedValues(ListIterate.collect(bigQueryFunction.taggedValues, t -> new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::extension::TaggedValue"))._tag(context.resolveTag(t.tag.profile, t.tag.value, t.tag.profileSourceInformation, t.tag.sourceInformation))._value(t.value)))
._functionName(bigQueryFunction.functionName)
._function(func)
._description(bigQueryFunction.description)
Expand All @@ -88,6 +91,5 @@ public Root_meta_external_function_activator_bigQueryFunction_BigQueryFunctionDe
{
return new Root_meta_external_function_activator_bigQueryFunction_BigQueryFunctionDeploymentConfiguration_Impl("")
._target((Root_meta_external_store_relational_runtime_RelationalDatabaseConnection) context.resolveConnection(configuration.activationConnection.connection, configuration.sourceInformation));
// ._stage(context.pureModel.getEnumValue("meta::external::function::activator::DeploymentStage", configuration.stage.name()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-m2-dsl-mapping-pure</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-runtime-java-engine-compiled</artifactId>
</dependency>

<!-- PURE -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.eclipse.collections.api.factory.Lists;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.impl.utility.ListIterate;
import org.finos.legend.engine.code.core.CoreFunctionActivatorCodeRepositoryProvider;
import org.finos.legend.engine.language.pure.compiler.toPureGraph.CompileContext;
import org.finos.legend.engine.language.pure.compiler.toPureGraph.extension.CompilerExtension;
Expand All @@ -34,6 +35,7 @@
import org.finos.legend.pure.generated.Root_meta_external_function_activator_hostedService_HostedService_Impl;
import org.finos.legend.pure.generated.Root_meta_external_function_activator_Ownership;
import org.finos.legend.pure.generated.Root_meta_external_function_activator_hostedService_UserList_Impl;
import org.finos.legend.pure.generated.Root_meta_pure_metamodel_extension_TaggedValue_Impl;
import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.PackageableFunction;
import org.finos.legend.pure.m3.navigation.function.FunctionDescriptor;

Expand Down Expand Up @@ -67,24 +69,13 @@ public Iterable<? extends Processor<?>> getExtraProcessors()
HostedService.class,
org.eclipse.collections.impl.factory.Lists.fixedSize.with(HostedServiceDeploymentConfiguration.class, ExecutionEnvironmentInstance.class, Function.class),
this::buildHostedService
)//,
// Processor.newProcessor(
// ExecutionEnvironmentInstance.class,
// org.eclipse.collections.impl.factory.Lists.fixedSize.with(PackageableConnection.class, PackageableRuntime.class),
// (execEnv, context) -> new Root_meta_legend_service_metamodel_ExecutionEnvironmentInstance_Impl(execEnv.name, null, context.pureModel.getClass("meta::legend::service::metamodel::ExecutionEnvironmentInstance"))
// ._name(execEnv.name),
// (execEnv, context) ->
// {
// Root_meta_legend_service_metamodel_ExecutionEnvironmentInstance pureExecEnv = (Root_meta_legend_service_metamodel_ExecutionEnvironmentInstance) context.pureModel.getOrCreatePackage(execEnv._package)._children().detect(c -> execEnv.name.equals(c._name()));
// pureExecEnv._executionParameters(ListIterate.collect(execEnv.executionParameters, params -> HelperHostedServiceBuilder.processExecutionParameters(params, context)));
// })
)
);
}

public Root_meta_external_function_activator_hostedService_HostedServiceDeploymentConfiguration buildDeploymentConfig(HostedServiceDeploymentConfiguration config, CompileContext context)
{
return new Root_meta_external_function_activator_hostedService_HostedServiceDeploymentConfiguration_Impl("", null, context.pureModel.getClass("meta::external::function::activator::hostedService::HostedServiceDeploymentConfiguration"));
// ._stage(context.pureModel.getEnumValue("meta::external::function::activator::DeploymentStage", config.stage.name()));
}

public Root_meta_external_function_activator_hostedService_HostedService buildHostedService(HostedService app, CompileContext context)
Expand All @@ -97,6 +88,8 @@ public Root_meta_external_function_activator_hostedService_HostedService buildHo
null,
context.pureModel.getClass("meta::external::function::activator::hostedService::HostedService")
)
._stereotypes(ListIterate.collect(app.stereotypes, s -> context.resolveStereotype(s.profile, s.value, s.profileSourceInformation, s.sourceInformation)))
._taggedValues(ListIterate.collect(app.taggedValues, t -> new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::extension::TaggedValue"))._tag(context.resolveTag(t.tag.profile, t.tag.value, t.tag.profileSourceInformation, t.tag.sourceInformation))._value(t.value)))
._pattern(app.pattern)
._function(func)
._documentation(app.documentation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-m3-core</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-runtime-java-engine-compiled</artifactId>
</dependency>
<!-- PURE -->

<!-- ENGINE -->
Expand Down Expand Up @@ -67,6 +71,10 @@
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId>
</dependency>
<!-- ECLIPSE COLLECTIONS -->

<!-- TEST -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.finos.legend.engine.language.memsqlFunction.compiler.toPureGraph;

import org.eclipse.collections.api.factory.Lists;
import org.eclipse.collections.impl.utility.ListIterate;
import org.finos.legend.engine.code.core.CoreFunctionActivatorCodeRepositoryProvider;
import org.finos.legend.engine.language.pure.compiler.toPureGraph.CompileContext;
import org.finos.legend.engine.language.pure.compiler.toPureGraph.extension.CompilerExtension;
Expand Down Expand Up @@ -62,6 +63,8 @@ public Root_meta_external_function_activator_memSqlFunction_MemSqlFunction build
memSqlFunction.name,
null,
context.pureModel.getClass("meta::external::function::activator::memSqlFunction::MemSqlFunction"))
._stereotypes(ListIterate.collect(memSqlFunction.stereotypes, s -> context.resolveStereotype(s.profile, s.value, s.profileSourceInformation, s.sourceInformation)))
._taggedValues(ListIterate.collect(memSqlFunction.taggedValues, t -> new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::extension::TaggedValue"))._tag(context.resolveTag(t.tag.profile, t.tag.value, t.tag.profileSourceInformation, t.tag.sourceInformation))._value(t.value)))
._functionName(memSqlFunction.functionName)
._function(func)
._description(memSqlFunction.description)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-m3-core</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-runtime-java-engine-compiled</artifactId>
</dependency>

<!-- PURE -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.eclipse.collections.api.factory.Lists;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.impl.utility.ListIterate;
import org.finos.legend.engine.code.core.CoreFunctionActivatorCodeRepositoryProvider;
import org.finos.legend.engine.language.pure.compiler.toPureGraph.CompileContext;
import org.finos.legend.engine.language.pure.compiler.toPureGraph.SourceInformationHelper;
Expand Down Expand Up @@ -70,6 +71,8 @@ public Root_meta_external_function_activator_snowflakeApp_SnowflakeApp buildSnow
SourceInformationHelper.toM3SourceInformation(app.sourceInformation),
context.pureModel.getClass("meta::external::function::activator::snowflakeApp::SnowflakeApp")
)
._stereotypes(ListIterate.collect(app.stereotypes, s -> context.resolveStereotype(s.profile, s.value, s.profileSourceInformation, s.sourceInformation)))
._taggedValues(ListIterate.collect(app.taggedValues, t -> new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::extension::TaggedValue"))._tag(context.resolveTag(t.tag.profile, t.tag.value, t.tag.profileSourceInformation, t.tag.sourceInformation))._value(t.value)))
._applicationName(app.applicationName)
._function(func)
._description(app.description)
Expand All @@ -88,6 +91,5 @@ public Root_meta_external_function_activator_snowflakeApp_SnowflakeDeploymentCon
{
return new Root_meta_external_function_activator_snowflakeApp_SnowflakeDeploymentConfiguration_Impl("")
._target((Root_meta_external_store_relational_runtime_RelationalDatabaseConnection) context.resolveConnection(configuration.activationConnection.connection, configuration.sourceInformation));
// ._stage(context.pureModel.getEnumValue("meta::external::function::activator::DeploymentStage", configuration.stage.name()));
}
}

0 comments on commit b3e9cd5

Please sign in to comment.