Skip to content

Commit

Permalink
Bump kit version from 1.0.0 to 1.1.0
Browse files Browse the repository at this point in the history
New Features:
 - Support site specific template feature.
 - Add leetcode.com template.
  • Loading branch information
silentsoft committed Sep 5, 2021
1 parent 4390382 commit 0522e7a
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 6 deletions.
27 changes: 25 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
## 1.0.0 (19 May 2021)
- The first proper release
# 1.1.0 (5 Sep 2021)

## New Features
- Add `site` property.

## Usages
```
$ ./mvnw -N acmicpc:create -Dproblem=two-sum -Dsite=leetcode.com
```

# 1.0.0 (19 May 2021)

## Usages
- Creating a problem
```
$ ./mvnw -N acmicpc:create -Dproblem=1234
```
- Creating a problem with specific template
```
$ ./mvnw -N acmicpc:create -Dproblem=1234 -Dtemplate=specific
```
- Revalidating project
```
$ ./mvnw -N acmicpc:revalidate
```
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Acmicpc Kit

![KitVersion](https://img.shields.io/badge/kit_version-v1.0.0-blue.svg)
![KitVersion](https://img.shields.io/badge/kit_version-v1.1.0-blue.svg)
[![Hits](https://hits.sh/github.com/silentsoft/acmicpc-kit.svg)](https://hits.sh)

> Let's practice algorithms with Acmicpc Kit !
Expand All @@ -16,6 +16,10 @@
```
$ ./mvnw -N acmicpc:create -Dproblem=1234 -Dtemplate=specific
```
- Creating a problem for specific site
```
$ ./mvnw -N acmicpc:create -Dproblem=two-sum -Dsite=leetcode.com
```
- Revalidating project
```
$ ./mvnw -N acmicpc:revalidate
Expand Down Expand Up @@ -44,7 +48,22 @@ If you want to create a new template then please follow these steps.
1. Edit `template` property in `pom.xml`.
```xml
<properties>
<template>new-template-dir-name</template>
<template>new-template-dir-name</template> <!-- e.g. 'java' -->
</properties>
```
### How to define a new template for specific site
This kit provides two site specific templates which is **acmicpc.net** and **leetcode.com**.
If you want to create a new template for new site then please follow these steps.
1. Create a new directory like `site-domain/template-name` under the `templates` directory.
1. Fill in the directory with your template files.
1. Edit `site` and `template` properties in `pom.xml`.
```xml
<properties>
<site>new-site-dir-name</site> <!-- e.g. 'leetcode.com' -->
<template>new-template-dir-name</template> <!-- e.g. 'java' -->
</properties>
```
Expand All @@ -53,7 +72,7 @@ If you want to create a new template then please follow these steps.
> Of course you can. Just create a new template directory under the `templates` and edit `template` property to template directory name in `pom.xml`.
- **I'm using another site(s) instead of acmicpc.net to solve algorithm problems. Can I use this program?**
> Of course you can. There are no restrictions on the use of this program. And you can edit the template. It's up to you.
> Of course you can. There are no restrictions on the use of this program. And you can edit the template. If you are using multiple sites then you can set `site` property. It's up to you.
- I just created a problem project but where is it ?
> It is created in the `problems` directory.
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<parent>
<groupId>org.silentsoft</groupId>
<artifactId>acmicpc-kit-parent</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</parent>
<groupId>org.silentsoft</groupId>
<artifactId>acmicpc-kit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<!--<site>leetcode.com</site>-->
<template>java</template>
</properties>
</project>
28 changes: 28 additions & 0 deletions templates/acmicpc.net/java/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import java.io.*;

public class Main {

public static void main(String[] args) throws Exception {
solve(createReader(), createWriter());
}

private static BufferedReader createReader() {
InputStream inputStream = Main.class.getResourceAsStream("SampleData.txt");
inputStream = (inputStream == null) ? System.in : inputStream;
return new BufferedReader(new InputStreamReader(inputStream));
}

private static BufferedWriter createWriter() {
return new BufferedWriter(new OutputStreamWriter(System.out));
}

private static void solve(BufferedReader reader, BufferedWriter writer) throws Exception {
String line = null;
while ((line = reader.readLine()) != null) {
//
}
writer.flush();
writer.close();
}

}
Empty file.
35 changes: 35 additions & 0 deletions templates/acmicpc.net/java/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.silentsoft</groupId>
<artifactId>acmicpc-kit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

<groupId>org.silentsoft.acmicpc.problems</groupId>
<artifactId>problem</artifactId>
<version>0.0.1-SNAPSHOT</version>

<build>
<sourceDirectory>${project.basedir}</sourceDirectory>
<resources>
<resource>
<directory>${project.basedir}</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.silentsoft.maven.plugins</groupId>
<artifactId>acmicpc-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
3 changes: 3 additions & 0 deletions templates/leetcode.com/java/Solution.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Solution {

}
11 changes: 11 additions & 0 deletions templates/leetcode.com/java/SolutionTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class SolutionTest {
@Test
public void test() {
Solution solution = new Solution();
//Assertions.assertEquals(/*expected*/, /*actual*/);
//Assertions.assertArrayEquals(/*expected*/, /*actual*/);
}
}
48 changes: 48 additions & 0 deletions templates/leetcode.com/java/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.silentsoft</groupId>
<artifactId>acmicpc-kit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

<groupId>org.silentsoft.acmicpc.problems</groupId>
<artifactId>problem</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.2</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>${project.basedir}</sourceDirectory>
<resources>
<resource>
<directory>${project.basedir}</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.silentsoft.maven.plugins</groupId>
<artifactId>acmicpc-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 0522e7a

Please sign in to comment.