Skip to content

Commit

Permalink
Add model-generator-commons dependency to projects
Browse files Browse the repository at this point in the history
  • Loading branch information
nipunayf committed Feb 16, 2025
1 parent 05275e7 commit 4364547
Show file tree
Hide file tree
Showing 23 changed files with 166 additions and 1,047 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ configurations {
}

dependencies {
implementation project(':architecture-model-generator:architecture-model-generator-core')
implementation project(":model-generator-commons")

implementation "org.ballerinalang:ballerina-lang:${ballerinaLangVersion}"
implementation "org.ballerinalang:ballerina-tools-api:${ballerinaLangVersion}"
implementation "org.ballerinalang:language-server-commons:${ballerinaLangVersion}"
implementation "org.eclipse.lsp4j:org.eclipse.lsp4j:${eclipseLsp4jVersion}"
implementation "com.google.code.gson:gson:${gsonVersion}"
implementation project(':architecture-model-generator:architecture-model-generator-core')

testImplementation project(':architecture-model-generator:architecture-model-generator-core')
testImplementation "org.ballerinalang:language-server-core:${ballerinaLangVersion}"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.ballerina.designmodelgenerator.core.model.Service;
import io.ballerina.designmodelgenerator.extension.request.GetDesignModelRequest;
import io.ballerina.designmodelgenerator.extension.response.GetDesignModelResponse;
import io.ballerina.modelgenerator.commons.AbstractLSTest;
import org.testng.Assert;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -112,6 +113,11 @@ protected Class<? extends AbstractLSTest> clazz() {
return DesignModelGeneratorTest.class;
}

@Override
protected String getServiceName() {
return "designModelService";
}

@Override
protected String getApiName() {
return "getDesignModel";
Expand Down
34 changes: 34 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,40 @@ def targetSequenceDiagramGeneratorCore = file("$project.rootDir/sequence-model-g
def targetSequenceDiagramGeneratorLSExt = file("$project.rootDir/sequence-model-generator/modules/sequence-model-generator-ls-extension/build/libs/sequence-model-generator-ls-extension-${project.version}.jar")
def targetTestManagerServiceLSExt = file("$project.rootDir/test-manager-service/modules/test-manager-service-ls-extension/build/libs/test-manager-service-ls-extension-${project.version}.jar")

// TODO: Remove this once the workspace manager is refactored to import modules where necessary.
def pullBallerinaModule(String packageName) {
tasks.register("pullBallerinaModule_${packageName.replace('/', '_')}") {
doLast {
def errOutput = new ByteArrayOutputStream()
def result = exec {
ignoreExitValue = true

// Check if the package exists in the ballerina user
def centralRepoDir = new File(System.getProperty("user.home"), ".ballerina/repositories/central.ballerina.io/bala/ballerinax")
if (centralRepoDir.exists()) {
def pkgDir = new File(centralRepoDir, packageName)
if (pkgDir.exists()) {
commandLine 'echo', "Package ${packageName} exists"
return
}
}

def ballPullCommand = "bal pull ballerinax/${packageName}"
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
commandLine 'cmd', '/c', ballPullCommand
} else {
commandLine '/bin/sh', '-c', ballPullCommand
}
errorOutput = errOutput
}
if (result.exitValue != 0) {
println errOutput
throw new GradleException("Failed to pull Ballerina module: ${packageName}")
}
}
}
}

task copyArtifactZip {
dependsOn(":model-generator-commons:build")
dependsOn(":architecture-model-generator:architecture-model-generator-core:build")
Expand Down
Loading

0 comments on commit 4364547

Please sign in to comment.