Skip to content

Commit 36299c0

Browse files
authored
Merge pull request #70 from jomof/master
Simple Kotlin
2 parents 29c3de4 + 6d6db2f commit 36299c0

File tree

17 files changed

+594
-586
lines changed

17 files changed

+594
-586
lines changed

.idea/codeStyleSettings.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.idea/modules/cdep/cdep-cdep_test.iml

Lines changed: 0 additions & 28 deletions
This file was deleted.

bootstrap/build.gradle

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java'
2+
apply plugin: 'kotlin'
23
group 'io.cdep'
34

45
if (System.getenv()["TRAVIS_TAG"] != null && System.getenv()["TRAVIS_TAG"].length() > 0) {
@@ -11,9 +12,13 @@ repositories {
1112
}
1213

1314
buildscript {
14-
repositories {
15+
ext.kotlin_version = '1.2.30'
16+
repositories {
1517
jcenter()
1618
}
19+
dependencies {
20+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
21+
}
1722
}
1823

1924
class GenerateBuildInfo extends DefaultTask {
@@ -56,4 +61,15 @@ dependencies {
5661
testCompile group: 'junit', name: 'junit', version: '4.11'
5762
testCompile group: 'com.google.guava', name: 'guava', version: '20.0'
5863
testCompile group: 'com.google.truth', name: 'truth', version: '0.31'
64+
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
65+
}
66+
compileKotlin {
67+
kotlinOptions {
68+
jvmTarget = "1.8"
69+
}
70+
}
71+
compileTestKotlin {
72+
kotlinOptions {
73+
jvmTarget = "1.8"
74+
}
5975
}

build.gradle

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java'
2+
apply plugin: 'kotlin'
23
group 'io.cdep'
34

45
if (System.getenv()["TRAVIS_TAG"] != null && System.getenv()["TRAVIS_TAG"].length() > 0) {
@@ -13,4 +14,24 @@ repositories {
1314

1415
dependencies {
1516
testCompile 'junit:junit:4.11'
17+
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
18+
}
19+
buildscript {
20+
ext.kotlin_version = '1.2.30'
21+
repositories {
22+
mavenCentral()
23+
}
24+
dependencies {
25+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
26+
}
27+
}
28+
compileKotlin {
29+
kotlinOptions {
30+
jvmTarget = "1.8"
31+
}
32+
}
33+
compileTestKotlin {
34+
kotlinOptions {
35+
jvmTarget = "1.8"
36+
}
1637
}

cdep-work.iml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id="cdep-work" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="io.cdep" external.system.module.version="dev" type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
7+
<excludeFolder url="file://$MODULE_DIR$/build" />
8+
<excludeFolder url="file://$MODULE_DIR$/out" />
9+
</content>
10+
<orderEntry type="inheritedJdk" />
11+
<orderEntry type="sourceFolder" forTests="false" />
12+
</component>
13+
</module>

cdep/build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java'
2+
apply plugin: 'kotlin'
23
group 'io.cdep'
34

45

@@ -7,12 +8,16 @@ repositories {
78
}
89

910
buildscript {
11+
ext.kotlin_version = '1.2.30'
1012
repositories {
1113
maven {
1214
url "https://plugins.gradle.org/m2/"
1315
}
1416
jcenter()
1517
}
18+
dependencies {
19+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
20+
}
1621
}
1722

1823

@@ -75,8 +80,19 @@ dependencies {
7580
testCompile group: 'com.google.truth', name: 'truth', version: '0.31'
7681
testCompile "org.mockito:mockito-core:2.+"
7782
testCompile group: 'net.java', name: 'quickcheck', version: '0.6'
83+
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
7884
}
7985

8086
jar {
8187
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
8288
}
89+
compileKotlin {
90+
kotlinOptions {
91+
jvmTarget = "1.8"
92+
}
93+
}
94+
compileTestKotlin {
95+
kotlinOptions {
96+
jvmTarget = "1.8"
97+
}
98+
}

cdep/src/main/java/io/cdep/CDep.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,7 @@ private boolean handleShow(@NotNull List<String> args)
472472
return false;
473473
}
474474

475-
private boolean handleShowManifest(@NotNull List<String> args)
476-
throws IOException, NoSuchAlgorithmException, URISyntaxException {
475+
private boolean handleShowManifest(@NotNull List<String> args) {
477476
if (args.size() > 0 && "show".equals(args.get(0))) {
478477
if (args.size() > 1 && "manifest".equals(args.get(1))) {
479478
assert config != null;
@@ -640,7 +639,7 @@ private FunctionTableExpression getFunctionTableExpression(@NotNull GeneratorEnv
640639
}
641640

642641
@NotNull
643-
private GeneratorEnvironment getGeneratorEnvironment(boolean forceRedownload, boolean ignoreManifestHashes) throws IOException {
642+
private GeneratorEnvironment getGeneratorEnvironment(boolean forceRedownload, boolean ignoreManifestHashes) {
644643
String downloadedPackagesFolder = null;
645644
String generatedModulesFolder = null;
646645
if (this.config != null) {
@@ -729,7 +728,7 @@ private void handleCallerID(@NotNull List<String> args) {
729728
private void handleOverrideBuildSystem(@NotNull List<String> args) {
730729
for (String overrideBuildSystem : eatStringArgument("-b", "--builder", args)) {
731730
BuildSystem result = null;
732-
for (BuildSystem buildSystem : BuildSystem.values()) {
731+
for (BuildSystem buildSystem : BuildSystem.values) {
733732
if (buildSystem.name.equals(overrideBuildSystem)) {
734733
result = buildSystem;
735734
}

0 commit comments

Comments
 (0)