在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):joningis/hugb_hello_world开源软件地址(OpenSource Url):https://github.com/joningis/hugb_hello_world开源编程语言(OpenSource Language):Java 95.6%开源软件介绍(OpenSource Introduction):hugb_hello_world(T-303-HUGB, Hugbúnaðarfræði, 2016-3) Sample program used to show students Gradle in action. What was done####NOTE: I used gradle 3.1 in the lecture. Create project
Project content
Show basic gradle tasks
Create basic code
package com.bangsapabbi.helloworld;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
apply plugin: 'application'
mainClassName = "com.bangsapabbi.helloworld.HelloWorld"
package com.bangsapabbi.helloworld;
public class HelloWorld {
public static void main(String[] args) {
World world = new World();
System.out.println(world.greet());
}
} package com.bangsapabbi.helloworld;
public class World {
public String greet() {
return "Hello world!";
}
} Testing
package com.bangsapabbi.helloworld;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class WorldTest {
@Test
public void greetResultsInHello() {
World world = new World();
assertEquals("Hello world!", world.greet());
}
}
bin folder
#!/bin/bash
./gradlew clean Gson (Not part of the project in git)
compile 'com.google.code.gson:gson:2.3' Refactoring World class to include gson output.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论