Initial Commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
#Thu Jan 28 06:57:37 CST 2016
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
Manifest-Version: 1.0
|
||||
Implementation-Title: Gradle Jar File Example
|
||||
Implementation-Version: 1.0
|
||||
Main-Class: Testing
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
|
||||
@@ -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