mirror of
https://github.com/cqfn/eo.git
synced 2024-10-04 04:07:19 +03:00
#58: skeleton
This commit is contained in:
parent
3630d47e66
commit
39454f788f
8
.gitattributes
vendored
Normal file
8
.gitattributes
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Check out all text files in UNIX format, with LF as end of line
|
||||
# Don't change this file. If you have any ideas about it, please
|
||||
# submit a separate issue about it and we'll discuss.
|
||||
|
||||
* text=auto eol=lf
|
||||
*.java ident
|
||||
*.xml ident
|
||||
*.png binary
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
target/
|
||||
.idea
|
||||
.DS_Store
|
||||
*.iml
|
||||
|
16
.travis.yml
Normal file
16
.travis.yml
Normal file
@ -0,0 +1,16 @@
|
||||
language: java
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
script:
|
||||
- set -e
|
||||
- mvn clean install -Pqulice --errors --batch-mode
|
||||
- mvn clean
|
||||
env:
|
||||
global:
|
||||
- MAVEN_OPTS="-Xmx256m"
|
||||
- JAVA_OPTS="-Xmx256m"
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
- oraclejdk7
|
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 eolang.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
167
pom.xml
Normal file
167
pom.xml
Normal file
@ -0,0 +1,167 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2016 eolang.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
-->
|
||||
<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>com.jcabi</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>0.48</version>
|
||||
</parent>
|
||||
<groupId>org.eolang</groupId>
|
||||
<artifactId>compiler</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>compiler</name>
|
||||
<description>EO-to-Java Compiler</description>
|
||||
<url>https://github.com/yegor256/eo</url>
|
||||
<inceptionYear>2016</inceptionYear>
|
||||
<organization>
|
||||
<name>EO</name>
|
||||
<url>https://github.com/yegor256/eo</url>
|
||||
</organization>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>MIT</name>
|
||||
<url>https://www.eolang.org/LICENSE.txt</url>
|
||||
<distribution>site</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>1</id>
|
||||
<name>Yegor Bugayenko</name>
|
||||
<email>yegor256@gmail.com</email>
|
||||
<organization>yegor256.com</organization>
|
||||
<organizationUrl>http://www.yegor256.com</organizationUrl>
|
||||
<roles>
|
||||
<role>Architect</role>
|
||||
<role>Developer</role>
|
||||
</roles>
|
||||
<timezone>-7</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
<issueManagement>
|
||||
<system>GitHub</system>
|
||||
<url>https://github.com/yegor256/eo/issues</url>
|
||||
</issueManagement>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:yegor256/eo.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:yegor256/eo.git</developerConnection>
|
||||
<url>https://github.com/yegor256/eo</url>
|
||||
</scm>
|
||||
<ciManagement>
|
||||
<system>rultor</system>
|
||||
<url>http://www.rultor.com/s/eo</url>
|
||||
</ciManagement>
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>github-pages</id>
|
||||
<url>https://github.com/yegor256/eo</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
<properties>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
<jdk.version>1.7</jdk.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcabi</groupId>
|
||||
<artifactId>jcabi-matchers</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcabi</groupId>
|
||||
<artifactId>jcabi-log</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>qulice</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.qulice</groupId>
|
||||
<artifactId>qulice-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes combine.children="append">
|
||||
<exclude>checkstyle:/src/site/resources/.*</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>coveralls</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eluder.coveralls</groupId>
|
||||
<artifactId>coveralls-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>site</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<repoToken>${coveralls.token}</repoToken>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
77
src/main/java/org/eolang/Main.java
Normal file
77
src/main/java/org/eolang/Main.java
Normal file
@ -0,0 +1,77 @@
|
||||
/**
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2016 eolang.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package org.eolang;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
/**
|
||||
* Main.
|
||||
*
|
||||
* @author Yegor Bugayenko (yegor256@gmail.com)
|
||||
* @version $Id$
|
||||
* @since 0.1
|
||||
*/
|
||||
public final class Main {
|
||||
|
||||
/**
|
||||
* Print stream for the output.
|
||||
*/
|
||||
private final PrintStream stdout;
|
||||
|
||||
/**
|
||||
* Arguments.
|
||||
*/
|
||||
private final String[] args;
|
||||
|
||||
/**
|
||||
* Ctor.
|
||||
* @param out Output stream
|
||||
* @param input Input args
|
||||
*/
|
||||
public Main(final PrintStream out, final String... input) {
|
||||
this.stdout = out;
|
||||
this.args = input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry point.
|
||||
* @param input Command line arguments
|
||||
* @checkstyle ProhibitPublicStaticMethods (3 lines)
|
||||
*/
|
||||
public static void main(final String... input) {
|
||||
new Main(System.out, input).exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry point.
|
||||
*/
|
||||
public void exec() {
|
||||
if ("--help".equals(this.args[0])) {
|
||||
this.stdout.append("It is just a skeleton");
|
||||
} else {
|
||||
this.stdout.append("Usage: --help");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
34
src/main/java/org/eolang/package-info.java
Normal file
34
src/main/java/org/eolang/package-info.java
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2016 eolang.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* EO Compiler.
|
||||
*
|
||||
* @author Yegor Bugayenko (yegor256@gmail.com)
|
||||
* @version $Id$
|
||||
* @since 0.1
|
||||
* @see <a href="http://www.eolang.org">project site www.eolang.org</a>
|
||||
* @see <a href="https://github.com/yegor256/eo">GitHub project</a>
|
||||
*/
|
||||
package org.eolang;
|
55
src/test/java/org/eolang/MainTest.java
Normal file
55
src/test/java/org/eolang/MainTest.java
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2016 eolang.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package org.eolang;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.hamcrest.MatcherAssert;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Test case for {@link Main}.
|
||||
* @author Yegor Bugayenko (yegor256@gmail.com)
|
||||
* @version $Id$
|
||||
* @since 0.1
|
||||
*/
|
||||
public final class MainTest {
|
||||
|
||||
/**
|
||||
* Main can print a simple text.
|
||||
* @throws Exception If some problem inside
|
||||
*/
|
||||
@Test
|
||||
public void printsSimpleResponse() throws Exception {
|
||||
try (final ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
|
||||
new Main(new PrintStream(baos), "--help").exec();
|
||||
MatcherAssert.assertThat(
|
||||
new String(baos.toByteArray()),
|
||||
Matchers.containsString("skeleton")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
32
src/test/java/org/eolang/package-info.java
Normal file
32
src/test/java/org/eolang/package-info.java
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2016 eolang.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* EO Compiler, tests.
|
||||
*
|
||||
* @author Yegor Bugayenko (yegor256@gmail.com)
|
||||
* @version $Id$
|
||||
* @since 0.1
|
||||
*/
|
||||
package org.eolang;
|
Loading…
Reference in New Issue
Block a user