Shanedell commented on code in PR #117: URL: https://github.com/apache/daffodil-vscode/pull/117#discussion_r885954444
########## src/omega_edit/server.ts: ########## @@ -0,0 +1,180 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as vscode from 'vscode' +import * as fs from 'fs' +import * as unzip from 'unzip-stream' +import * as os from 'os' +import * as child_process from 'child_process' +import { HttpClient } from 'typed-rest-client/HttpClient' +import XDGAppPaths from 'xdg-app-paths' + +const xdgAppPaths = XDGAppPaths({ name: 'omega_edit' }) + +class Backend { + constructor(readonly owner: string, readonly repo: string) {} +} + +class Artifact { + constructor(readonly omegaEditVersion: string) {} + + name = `omega-edit-scala-server-${this.omegaEditVersion}` + archive = `${this.name}.zip` + archiveUrl = (backend: Backend) => + `https://github.com/${backend.owner}/${backend.repo}/releases/download/v${this.omegaEditVersion}/${this.archive}` + + scriptName = os.platform().toLowerCase().startsWith('win32') + ? 'example-grpc-server.bat' + : './example-grpc-server' + + getOsFolder() { + if (os.platform().toLowerCase().startsWith('win')) { + return 'windows' + } else if (os.platform().toLowerCase().startsWith('darwin')) { + return 'macos' + } else { + return 'linux' + } + } +} + +// Method to get omegaEditVersion from a JSON file +export function getOmegaEditVersion(filePath: fs.PathLike) { + return JSON.parse(fs.readFileSync(filePath).toString())['omegaEditVersion'] +} + +export async function startServer(ctx: vscode.ExtensionContext) { + // Get omegaEditVersion + const omegaEditVersion = getOmegaEditVersion( + ctx.asAbsolutePath('./package.json') + ) + const artifact = new Artifact(omegaEditVersion) + const backend = new Backend('ctc-oss', 'omega-edit') Review Comment: @stevedlawrence I added all of the scala depedencies these are the only ones packaged into the `omega-edit-scala-server-<VERSION>.zip` that had different licenses or used ALv2 and had a notice. There are no depedencies for the C++ code that get put into the shared library so the Scala are the only ones needed. These had used ALv2 without a notice: ```bash omega-edit* example-grpc-server.example-grpc-server-* #this is from omega-edit we need to change its name com.github.jnr.jffi-1.3.9-native.jar com.github.jnr.jffi-1.3.9.jar com.github.jnr.jnr-a64asm-1.0.0.jar com.github.jnr.jnr-ffi-2.2.11.jar com.github.jnr.jnr-x86asm-1.0.2.jar com.google.android.annotations-4.1.1.4.jar com.google.code.findbugs.jsr305-3.0.2.jar com.google.code.gson.gson-2.8.9.jar com.google.errorprone.error_prone_annotations-2.9.0.jar com.google.guava.failureaccess-1.0.1.jar com.google.guava.guava-30.1.1-android.jar com.google.guava.listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar com.google.j2objc.j2objc-annotations-1.3.jar com.lightbend.akka.grpc.akka-grpc-runtime_2.13-2.1.3.jar com.thesamet.scalapb.lenses_2.13-0.11.8.jar com.thesamet.scalapb.scalapb-runtime_2.13-0.11.8.jar com.typesafe.akka.akka-actor_2.13-2.6.9.jar com.typesafe.akka.akka-discovery_2.13-2.6.9.jar com.typesafe.akka.akka-protobuf-v3_2.13-2.6.9.jar com.typesafe.akka.akka-stream_2.13-2.6.9.jar com.typesafe.config-1.4.0.jar com.typesafe.ssl-config-core_2.13-0.4.2.jar ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
