Initial Commit
This commit is contained in:
1
java/testing/.gradle/2.10/taskArtifacts/cache.properties
Normal file
1
java/testing/.gradle/2.10/taskArtifacts/cache.properties
Normal file
@@ -0,0 +1 @@
|
||||
#Thu Jan 28 06:57:37 CST 2016
|
BIN
java/testing/.gradle/2.10/taskArtifacts/cache.properties.lock
Normal file
BIN
java/testing/.gradle/2.10/taskArtifacts/cache.properties.lock
Normal file
Binary file not shown.
BIN
java/testing/.gradle/2.10/taskArtifacts/fileHashes.bin
Normal file
BIN
java/testing/.gradle/2.10/taskArtifacts/fileHashes.bin
Normal file
Binary file not shown.
BIN
java/testing/.gradle/2.10/taskArtifacts/fileSnapshots.bin
Normal file
BIN
java/testing/.gradle/2.10/taskArtifacts/fileSnapshots.bin
Normal file
Binary file not shown.
BIN
java/testing/.gradle/2.10/taskArtifacts/outputFileStates.bin
Normal file
BIN
java/testing/.gradle/2.10/taskArtifacts/outputFileStates.bin
Normal file
Binary file not shown.
BIN
java/testing/.gradle/2.10/taskArtifacts/taskArtifacts.bin
Normal file
BIN
java/testing/.gradle/2.10/taskArtifacts/taskArtifacts.bin
Normal file
Binary file not shown.
27
java/testing/build.gradle
Normal file
27
java/testing/build.gradle
Normal file
@@ -0,0 +1,27 @@
|
||||
apply plugin: "java"
|
||||
apply plugin: "eclipse"
|
||||
apply plugin: "idea"
|
||||
|
||||
version = '1.0'
|
||||
sourceCompatibility = 1.7
|
||||
targetCompatibility = 1.7
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile "junit:junit:4.10"
|
||||
}
|
||||
|
||||
//create a single Jar with all dependencies
|
||||
task fatJar(type: Jar) {
|
||||
manifest {
|
||||
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
||||
'Implementation-Version': version,
|
||||
'Main-Class': 'Testing'
|
||||
}
|
||||
baseName = project.name + '-all'
|
||||
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||
with jar
|
||||
}
|
BIN
java/testing/build/classes/main/Testing.class
Normal file
BIN
java/testing/build/classes/main/Testing.class
Normal file
Binary file not shown.
BIN
java/testing/build/libs/testing-all-1.0.jar
Normal file
BIN
java/testing/build/libs/testing-all-1.0.jar
Normal file
Binary file not shown.
5
java/testing/build/tmp/fatJar/MANIFEST.MF
Normal file
5
java/testing/build/tmp/fatJar/MANIFEST.MF
Normal file
@@ -0,0 +1,5 @@
|
||||
Manifest-Version: 1.0
|
||||
Implementation-Title: Gradle Jar File Example
|
||||
Implementation-Version: 1.0
|
||||
Main-Class: Testing
|
||||
|
2
java/testing/build/tmp/jar/MANIFEST.MF
Normal file
2
java/testing/build/tmp/jar/MANIFEST.MF
Normal file
@@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
|
35
java/testing/src/main/java/Testing.java
Normal file
35
java/testing/src/main/java/Testing.java
Normal file
@@ -0,0 +1,35 @@
|
||||
import java.util.*;
|
||||
|
||||
public class Testing {
|
||||
public static void main(String[] args) {
|
||||
|
||||
if("pangram".equals(args[0])) {
|
||||
if(testPangram(args[1])) {
|
||||
System.out.println("true");
|
||||
} else {
|
||||
System.out.println("false");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean testPangram(String test) {
|
||||
System.out.println("Pangram Testing ("+test+")");
|
||||
char ch = 'a';
|
||||
char[] strBytes = test.toLowerCase().toCharArray();
|
||||
for(int i = 0; i < 26; i++) {
|
||||
boolean foundChar = false;
|
||||
for(int j = 0; j < strBytes.length; j++) {
|
||||
if(strBytes[j] == ch) {
|
||||
foundChar = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ch++;
|
||||
if(foundChar) {
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user