I'm trying to use the Hugo library developed by Jake Wharton.
I added the statement:
compile 'com.jakewharton.hugo:hugo-plugin:1.2.1'
to my dependencies in my build.gradle file at the app level.
Then when I try to annotate with @DebugLog
on my methods, it appears in red, as if the IDE doesn't recognize it.
I tried typing in an import statement like:
import com.jakewharton.hugo;
but the jakewharton
part of the import statement appears in red, meaning it doesn't see it.
I've googled, and found references like:
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
I'm not sure what the difference between compile and classpath is.
Also, I see a reference to:
apply plugin: 'hugo'
Where should that go?
As you can see I'm totally lost. Any ideas on how to make this work is greatly appreaciated.
To add a module as a dependency of a site, we have to run the command hugo mod get <module path> . Then add an entry for the module in site configuration (in a config. yaml or config. toml file).
Hokus CMS is an open source, multi-platform, easy to use, desktop application for Hugo. Build from simple to complex user interfaces for Hugo websites by choosing from a dozen ready-to-use components — all for free, with no vendor lock-in.
I'm not sure you are referencing the app module build.gradle or the project level build.gradle.
But eventually, I put it all in the app module build.grade and it worked for me. This is how the file looked like:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.hugo'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.app_name"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
}
A correct configuration would look like this in your build.gradle
file:
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.hugo'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
}
dependencies {
// Other dependencies
}
There is no need to add Hugo to the second dependencies
section, this is done for you by the plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With