Skip to content

Commit

Permalink
Provided windows compatibility for ExactproMetaInf
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro committed Sep 26, 2024
1 parent 0c70cd5 commit ff65f24
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# th2 common library (Java) (5.14.0)
# th2 common library (Java) (5.14.1)

## Usage

Expand Down Expand Up @@ -511,6 +511,10 @@ dependencies {

## Release notes

### 5.14.1-dev

+ Provided windows compatibility

### 5.14.0-dev

+ Separate connections for publisher and consumer (allows to consume while publishing is blocked by RabbitMQ)
Expand Down
17 changes: 1 addition & 16 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
#
# Copyright 2022-2024 Exactpro (Exactpro Systems Limited)
#
# Licensed 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.
#
release_version=5.14.0
release_version=5.14.1
kotlin_version=1.8.22
description='th2 common library (Java)'
vcs_url=https://github.com/th2-net/th2-common-j
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Exactpro (Exactpro Systems Limited)
* Copyright 2023-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,16 @@ internal class ExactproMetaInf(
private val title: String,
private val version: String
) {
private val jarPath = Path.of(url.path).parent.parent
private val jarPath: Path = url.toURI().run {
// the code below are added to provide windows compatibility
when (scheme) {
"file" -> Path.of(this)
"jar" -> Path.of(
schemeSpecificPart.substringBefore("!").removePrefix("file:")
)
else -> error("The '$scheme' schema of '$this' URI can't be handled")
}.parent.parent
}

private var gitEnriched = false
private var gitHash = ""
Expand Down Expand Up @@ -106,7 +115,7 @@ internal class ExactproMetaInf(
attributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION)
)
}
} catch (e: IOException) {
} catch (e: Exception) {
K_LOGGER.warn(e) { "Manifest '$manifestUrl' loading failure" }
return null
}
Expand Down

0 comments on commit ff65f24

Please sign in to comment.