build.gradle - How to refer or link the Java src with test structure in Gradle -
i'm new gradle i'm facing problem while compiling test classes i'm referring java classes in test classes test program couldn't compile. problem wouldn't understand how link or refer java src structure test structure. me how resolve issues.
below provided screenshot of src , test package structure , compilation problem.
java src , test structure
compilation error
build.properties
apply plugin: 'java' sourcecompatibility = '1.7' [compilejava, compiletestjava]*.options*.encoding = 'utf-8' // netbeans automatically add "run" , "debug" tasks relying on // "mainclass" property. may define property prior executing // tasks passing "-pmainclass=<qualified_class_name>" argument. // // note however, may define own "run" , "debug" task if // prefer. in case netbeans not add these tasks may rely on // own implementation. if (!hasproperty('mainclass')) { ext.mainclass = '' } jar { manifest { attributes 'main-class': 'com.gradle.shopcart.shopcartapp' } } repositories { mavencentral() // may define additional repositories, or remove "mavencentral()". // read more repositories here: // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories } dependencies { // todo: add dependencies here ... // can read more how add dependency here: // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies testcompile group: 'junit', name: 'junit', version: '4.12' }
edit::
i'm using netbeans, of gradle plugin created project structure below can find screenshot. if miss please correct me.
please let me know in case of more information.
Comments
Post a Comment