Gradle Multimodule Project无法解析依赖子模块的类

时间:2018-07-21 12:45:45

标签: gradle groovy dependencies multi-module

该应用程序在Eclipse中运行良好。但是我无法通过gradle(class Location extends Model { protected $fillable = [/*An array that contains a list of fields of your table*/]; //When you do Locations::create($arrayOfData);, Laravel will do insert into ($fillables) values ($arrayOfData). //Hidden means they'll be hidden whenever you fetch an object type of Location protected $hidden = ["created_at","updated_at"]; //Here, we establish a relationship this model has to reports //You can further down and set custom to what are the foreign keys and local keys on the link above public function reports() { return $this->hasMany("App\Models\Report"); } } class Report extends Model { protected $fillable =['id','location_id',...]; protected $hidden = ["created_at","updated_at"]; public function reports() { return $this->belongsTo("App\Models\Location"); } }

构建应用程序

结构类似于:

Location::with('report')->get();(父母)

  • gradle clean build
  • financial-calculator

library要使用api

我父母的api文件:

library

settings.gradle文件:

rootProject.name = 'financial-calculator'

include 'library'
include 'api'  

rootProject.children.each { it.name = rootProject.name + '-' + it.name }

您将在link下找到完整的小型项目

感谢您的提示。

0 个答案:

没有答案