Skip to content

Commit

Permalink
GH-92 Rename reposilite-backend to reposilite
Browse files Browse the repository at this point in the history
  • Loading branch information
dzikoysk committed May 29, 2020
1 parent 6e6e20f commit 630fd57
Show file tree
Hide file tree
Showing 46 changed files with 590 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.panda-lang</groupId>
<artifactId>reposilite</artifactId>
<artifactId>reposilite-parent</artifactId>
<packaging>pom</packaging>
<version>2.5.0</version>

<modules>
<module>reposilite-backend</module>
</modules>
Expand Down
4 changes: 2 additions & 2 deletions reposilite-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>reposilite</artifactId>
<artifactId>reposilite-parent</artifactId>
<groupId>org.panda-lang</groupId>
<version>2.5.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>reposilite-backend</artifactId>
<artifactId>reposilite</artifactId>

<properties>
<!-- Reposilite properties -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Copyright (c) 2020 Dzikoysk
*
* 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.
*/

package org.panda_lang.reposilite.metadata;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.panda_lang.reposilite.utils.FilesUtils;

import java.io.File;
import java.io.IOException;
import java.util.stream.Stream;

class MetadataUtilsTest {

@TempDir
static File temp;
static File builds;
static File versions;

private static final String[] BUILDS = {
"abc-version-timestamp.jar",
"abc-version-timestamp-classifier.jar",
"abc-version-timestamp-2-classifier.jar",
"abc-version-timestamp-1.jar",
"abc-version-timestamp-1-classifier.jar",
};

private static final String[] VERSIONS = { "2", "1" };

@BeforeAll
static void prepare() throws IOException {
builds = new File(temp, "builds");
builds.mkdir();

for (String file : BUILDS) {
new File(builds, file).createNewFile();
}

versions = new File(temp, "versions");
versions.mkdir();

for (String version : VERSIONS) {
new File(versions, version).mkdir();
}
}

@Test
void toSortedBuilds() {
Assertions.assertArrayEquals(BUILDS, Stream.of(MetadataUtils.toSortedBuilds(builds))
.map(File::getName)
.toArray(String[]::new)
);
}

@Test
void toSortedVersions() {
Assertions.assertArrayEquals(VERSIONS, Stream.of(MetadataUtils.toSortedVersions(versions))
.map(File::getName)
.toArray(String[]::new)
);
}

@Test
void toSortedIdentifiers() {
Assertions.assertArrayEquals(new String[] {
"timestamp-2",
"timestamp-1",
"timestamp"
}, MetadataUtils.toSortedIdentifiers("abc", "version", FilesUtils.listFiles(builds)));
}

@Test
void toBuildFiles() {
Assertions.assertArrayEquals(BUILDS, Stream.of(MetadataUtils.toBuildFiles(builds, "timestamp"))
.map(File::getName)
.toArray(String[]::new)
);
}

@Test
void getLatest() {
Assertions.assertEquals("2", MetadataUtils.getLatest(VERSIONS));
}

@Test
void getLast() {
Assertions.assertEquals("1", MetadataUtils.getLast(VERSIONS));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<metadata><groupId>org</groupId><artifactId>panda-lang</artifactId><versioning><release>reposilite-test</release><latest>reposilite-test</latest><lastUpdated>20200526104801</lastUpdated><versions><version>reposilite-test</version><version>reposilite</version></versions></versioning></metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5a8dccb220de5c6775c873ead6ff2e43
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3c7435cfd4e31b9be3991041c9a4f8292b752e5b
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7a900f53c20c38d1119a86cc72f352e4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2cb07e420d982b9445e8d3530f8304eef0b0b4a9
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 Dzikoysk
~
~ 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.
-->

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.panda-lang</groupId>
<artifactId>reposilite-test</artifactId>
<version>1.0.0</version>
<description>POM was created from install:install-file</description>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
50f79edd59ffaf8dd66b42be0867da5c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9333c3866f26da9a8213bda5d0c47733348a11cb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<metadata><groupId>org.panda-lang</groupId><artifactId>reposilite-test</artifactId><versioning><release>1.0.1</release><latest>1.0.1</latest><lastUpdated>20200509124828</lastUpdated><versions><version>1.0.1</version><version>1.0.0</version></versions></versioning></metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d4f6f4e928303d5361d83531beb5260f
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11255f8e4b2473037698c0e90936b2dbbfc27173
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
04f953dbf697968e3c1a1dc17ff99ecc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bf2049dfcd525a12603f1a34a0bfad1d7c05b645
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ca2abcc166c9df19a5997d384ed25f5b
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7a82879a3f4584cf1d3b181628864885d2c20094
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 Dzikoysk
~
~ 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.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.panda-lang</groupId>
<artifactId>reposilite</artifactId>
<version>2.5.0</version>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<build>
<defaultGoal>clean install</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<artifact>com.fasterxml.woodstox:woodstox-core</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>commons-logging:commons-logging</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
<configuration>
<source>${reposilite.javaLanguageLevel}</source>
<target>${reposilite.javaVersion}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Implementation-Title>Reposilite</Implementation-Title>
<Implementation-Version>${reposilite.version}</Implementation-Version>
<Main-Class>org.panda_lang.reposilite.Reposilite</Main-Class>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>panda-repository</id>
<name>Panda Repository</name>
<url>https://repo.panda-lang.org/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>apiguardian-api</artifactId>
<groupId>org.apiguardian</groupId>
</exclusion>
<exclusion>
<artifactId>opentest4j</artifactId>
<groupId>org.opentest4j</groupId>
</exclusion>
<exclusion>
<artifactId>junit-platform-commons</artifactId>
<groupId>org.junit.platform</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>junit-platform-engine</artifactId>
<groupId>org.junit.platform</groupId>
</exclusion>
<exclusion>
<artifactId>apiguardian-api</artifactId>
<groupId>org.apiguardian</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>local-repository</id>
<url>http://localhost/releases</url>
</repository>
</distributionManagement>
<properties>
<reposilite.javaVersion>1.8</reposilite.javaVersion>
<maven.compiler.target>${reposilite.javaVersion}</maven.compiler.target>
<maven.compiler.source>${reposilite.javaLanguageLevel}</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<reposilite.javaLanguageLevel>1.8</reposilite.javaLanguageLevel>
<reposilite.version>${project.version}</reposilite.version>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5f81766868fddb13127a323fbf57d741
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f07fa28afaa08ba09418ec5a7bb7652da70afc9c
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0eb380ab2ccc6c86c4406ed6d72ce2a2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6bb0edcb7b45fbd66f3da1cf970b2ed3226b8338
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
89c8b3568e4ed0a762b60467540df3f1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5dced3f520d6012df13a4783b9449ec637ad459f
Loading

0 comments on commit 630fd57

Please sign in to comment.