done
This commit is contained in:
418
Model/Model_ResNet-50_Tomato-leaf-disease.py
Normal file
418
Model/Model_ResNet-50_Tomato-leaf-disease.py
Normal file
@ -0,0 +1,418 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Skripsi ResNet-50_Tomato Leaf Disease Classification_FINAL.ipynb
|
||||
|
||||
Automatically generated by Colab.
|
||||
|
||||
Original file is located at
|
||||
https://colab.research.google.com/drive/1DCYce_7Aik3nvrZQM-_YWCoyeyZBu4KH
|
||||
|
||||
# Libraries
|
||||
"""
|
||||
|
||||
!nvidia-smi
|
||||
|
||||
!pip install tensorflow
|
||||
!pip install tensorflowjs
|
||||
|
||||
!pip list
|
||||
|
||||
import tensorflow as tf
|
||||
import numpy as np
|
||||
# import tensorflowjs as tfjs
|
||||
from tensorflow.keras.applications.resnet50 import ResNet50, preprocess_input
|
||||
import matplotlib.pyplot as plt
|
||||
from tensorflow.keras import layers
|
||||
from tensorflow.keras.utils import plot_model
|
||||
from tensorflow.keras.utils import image_dataset_from_directory
|
||||
from tensorflow.keras import mixed_precision
|
||||
|
||||
print("TensorFlow version:", tf.__version__)
|
||||
print("GPU detected:", tf.config.list_physical_devices('GPU'))
|
||||
mixed_precision.set_global_policy('mixed_float16')
|
||||
|
||||
!nvcc --version
|
||||
|
||||
# from google.colab import drive
|
||||
# drive.mount('/content/drive')
|
||||
|
||||
# !unzip "/content/drive/MyDrive/daun tomat/tomato_leaf_disease_dataset.zip" -d "/content"
|
||||
# !unzip "/content/drive/MyDrive/daun tomat/tomato_leaf_disease_dataset_nobg.zip" -d "/content"
|
||||
|
||||
!unzip 'tomato_leaf_disease_dataset.zip'
|
||||
|
||||
"""# Read dataset"""
|
||||
|
||||
dataset_dir = '/content/tomato_leaf_disease_dataset'
|
||||
|
||||
image_size = (224, 224)
|
||||
|
||||
train_dataset = image_dataset_from_directory(
|
||||
dataset_dir,
|
||||
batch_size=32,
|
||||
image_size=image_size,
|
||||
seed=42,
|
||||
validation_split=0.2,
|
||||
subset="training",
|
||||
)
|
||||
|
||||
val_dataset = image_dataset_from_directory(
|
||||
dataset_dir,
|
||||
batch_size=32,
|
||||
image_size=image_size,
|
||||
seed=42,
|
||||
validation_split=0.2,
|
||||
subset="validation",
|
||||
)
|
||||
|
||||
classes = train_dataset.class_names
|
||||
|
||||
"""# Show some of dataset"""
|
||||
|
||||
plt.figure(figsize=(15, 20))
|
||||
for images, labels in train_dataset.take(1):
|
||||
for i in range(16):
|
||||
plt.subplot(8, 4, i + 1)
|
||||
plt.imshow(images[i]/255)
|
||||
plt.title(f"{classes[labels[i].numpy()]}")
|
||||
plt.axis(False);
|
||||
|
||||
"""# Cache"""
|
||||
|
||||
train_ds = train_dataset.cache().prefetch(tf.data.AUTOTUNE)
|
||||
val_ds = val_dataset.cache().prefetch(tf.data.AUTOTUNE)
|
||||
|
||||
"""#Model"""
|
||||
|
||||
resnet = ResNet50(include_top=False, weights='imagenet')
|
||||
resnet.trainable = False
|
||||
|
||||
inputs = layers.Input(shape=(224, 224, 3))
|
||||
x = preprocess_input(inputs)
|
||||
x = resnet(inputs, training=False)
|
||||
x = layers.GlobalAveragePooling2D()(x)
|
||||
x = layers.Dropout(0.25)(x)
|
||||
outputs = layers.Dense(
|
||||
len(classes),
|
||||
activation='softmax'
|
||||
)(x)
|
||||
|
||||
|
||||
model = tf.keras.Model(inputs=inputs, outputs=outputs)
|
||||
|
||||
model.summary()
|
||||
|
||||
plot_model(model, show_shapes=True, show_layer_activations=True, dpi=70)
|
||||
|
||||
"""# Set Loss Function and Optimizer"""
|
||||
|
||||
model.compile(optimizer='adam', loss=tf.keras.losses.SparseCategoricalCrossentropy(), metrics=[tf.keras.metrics.SparseCategoricalAccuracy(name='accuracy')])
|
||||
|
||||
"""# Callback
|
||||
|
||||
"""
|
||||
|
||||
import tensorflow as tf
|
||||
from tensorflow.keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau
|
||||
|
||||
early_stop_callback = EarlyStopping(
|
||||
monitor='val_loss',
|
||||
patience=3,
|
||||
restore_best_weights=True,
|
||||
verbose=0
|
||||
)
|
||||
|
||||
reduce_lr_callback = ReduceLROnPlateau(
|
||||
monitor='val_loss',
|
||||
factor=0.5,
|
||||
patience=2,
|
||||
min_lr=1e-6,
|
||||
verbose=0
|
||||
)
|
||||
|
||||
checkpoint_callback = ModelCheckpoint(
|
||||
filepath='best_model.weights.h5',
|
||||
monitor='val_loss',
|
||||
save_weights_only=True,
|
||||
save_best_only=True,
|
||||
mode='min',
|
||||
verbose=0
|
||||
)
|
||||
|
||||
callbacks = [early_stop_callback, reduce_lr_callback, checkpoint_callback]
|
||||
|
||||
"""# Train Model"""
|
||||
|
||||
hist = model.fit(
|
||||
train_ds,
|
||||
validation_data=val_ds,
|
||||
epochs=100,
|
||||
callbacks=callbacks,
|
||||
)
|
||||
|
||||
"""# Visualize the train and validation accuracy&loss"""
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
def plot_curves(history):
|
||||
acc = history.history['accuracy']
|
||||
val_acc = history.history['val_accuracy']
|
||||
loss = history.history['loss']
|
||||
val_loss = history.history['val_loss']
|
||||
epochs = range(len(history.history['accuracy']))
|
||||
|
||||
plt.title("Train and Val Accuracy")
|
||||
plt.plot(epochs, acc, label='training_acc')
|
||||
plt.plot(epochs, val_acc, label='val_acc')
|
||||
plt.ylabel('Accuracy')
|
||||
plt.xlabel('Epoch')
|
||||
plt.legend(loc="lower right")
|
||||
|
||||
plt.figure()
|
||||
plt.title("Train and Val Loss")
|
||||
plt.plot(epochs, loss, label='training_loss')
|
||||
plt.plot(epochs, val_loss, label='val_loss')
|
||||
plt.ylabel('Loss')
|
||||
plt.xlabel('Epoch')
|
||||
plt.legend()
|
||||
|
||||
plot_curves(hist)
|
||||
|
||||
from sklearn.metrics import classification_report
|
||||
import numpy as np
|
||||
|
||||
class_names = train_dataset.class_names
|
||||
|
||||
y_pred = []
|
||||
y_true = []
|
||||
|
||||
for images, labels in val_dataset:
|
||||
predictions = model.predict(images)
|
||||
y_pred.extend(np.argmax(predictions, axis=1))
|
||||
y_true.extend(labels.numpy())
|
||||
|
||||
# Hasilkan laporan klasifikasi
|
||||
report = classification_report(y_true, y_pred, target_names=class_names)
|
||||
print(report)
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import seaborn as sns
|
||||
from sklearn.metrics import confusion_matrix
|
||||
import random
|
||||
|
||||
# Buat confusion matrix
|
||||
cm = confusion_matrix(y_true, y_pred)
|
||||
plt.figure(figsize=(10, 8))
|
||||
sns.heatmap(cm, annot=True, fmt="d", cmap="Blues", xticklabels=class_names, yticklabels=class_names)
|
||||
plt.xlabel("Predicted Label")
|
||||
plt.ylabel("True Label")
|
||||
plt.title("Confusion Matrix")
|
||||
plt.show()
|
||||
|
||||
|
||||
all_images = []
|
||||
all_labels = []
|
||||
|
||||
for images, labels in val_dataset:
|
||||
all_images.extend(images)
|
||||
all_labels.extend(labels)
|
||||
|
||||
# Ambil indeks acak
|
||||
num_samples = 9
|
||||
indices = random.sample(range(len(all_images)), num_samples)
|
||||
|
||||
plt.figure(figsize=(15, 10))
|
||||
for i, idx in enumerate(indices):
|
||||
img = all_images[idx]
|
||||
true_label = all_labels[idx].numpy()
|
||||
|
||||
pred = model.predict(np.expand_dims(img, axis=0))
|
||||
pred_label = np.argmax(pred, axis=1)[0]
|
||||
|
||||
plt.subplot(3, 3, i+1)
|
||||
plt.imshow(img.numpy().astype("uint8"))
|
||||
plt.title(f"True: {class_names[true_label]}\nPred: {class_names[pred_label]}")
|
||||
plt.axis('off')
|
||||
|
||||
plt.tight_layout()
|
||||
plt.show()
|
||||
|
||||
"""# Save model"""
|
||||
|
||||
model.save('ResNet-50_tomato-leaf-disease.keras');
|
||||
|
||||
import tensorflow as tf
|
||||
|
||||
model = tf.keras.models.load_model('/content/ResNet-50_tomato-leaf-disease.keras')
|
||||
|
||||
model.summary()
|
||||
model.save('/content/drive/MyDrive/model_pak_ridwan_custom.h5')
|
||||
print("Model telah disimpan dalam format .h5")
|
||||
|
||||
model.export('saved_model/')
|
||||
|
||||
tfjs.converters.save_keras_model(model, 'ResNet-50_tomato-leaf-disease-tfjs/')
|
||||
|
||||
converter = tf.lite.TFLiteConverter.from_keras_model(model)
|
||||
converter.target_spec.supported_ops = [
|
||||
tf.lite.OpsSet.TFLITE_BUILTINS,
|
||||
tf.lite.OpsSet.SELECT_TF_OPS
|
||||
]
|
||||
converter.optimizations = [tf.lite.Optimize.DEFAULT]
|
||||
|
||||
tflite_model = converter.convert()
|
||||
|
||||
with open('ResNet-50_tomato-leaf-disease_v8.tflite', 'wb') as f:
|
||||
f.write(tflite_model)
|
||||
|
||||
"""# Predict an image"""
|
||||
|
||||
import tensorflow as tf
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
# Load Model
|
||||
model = tf.keras.models.load_model('ResNet-50_tomato-leaf-disease.keras', compile=False)
|
||||
|
||||
|
||||
# Load dan praproses gambar
|
||||
img_path = '/content/fd3a25ef-50f2-4ca2-a20d-d0a99bcbae13___GCREC_Bact-Sp-6394_JPG.rf.1e9be7991e041d414a175bc85e0e505b.jpg'
|
||||
image = tf.keras.utils.load_img(img_path, target_size=(224, 224))
|
||||
image_array = tf.keras.utils.img_to_array(image)
|
||||
image_array = tf.expand_dims(image_array, axis=0)
|
||||
|
||||
# Prediksi
|
||||
predict = model.predict(image_array)
|
||||
predicted_index = np.argmax(predict, axis=1)[0]
|
||||
predicted_class = classes[predicted_index]
|
||||
predicted_prob = predict[0][predicted_index]
|
||||
|
||||
# Tampilkan hasil
|
||||
plt.imshow(image)
|
||||
plt.title(f"Prediksi: {predicted_class}; Probability: {predicted_prob:.2f}")
|
||||
plt.axis('off')
|
||||
plt.show()
|
||||
|
||||
import tensorflow as tf
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
# Fungsi untuk load model TFLite
|
||||
def load_tflite_model(model_path):
|
||||
interpreter = tf.lite.Interpreter(model_path=model_path)
|
||||
interpreter.allocate_tensors()
|
||||
return interpreter
|
||||
|
||||
# Load model TFLite
|
||||
model_tflite = load_tflite_model('ResNet-50_tomato-leaf-disease.tflite')
|
||||
|
||||
# Load dan praproses gambar
|
||||
img_path = '/content/fd3a25ef-50f2-4ca2-a20d-d0a99bcbae13___GCREC_Bact-Sp-6394_JPG.rf.1e9be7991e041d414a175bc85e0e505b.jpg'
|
||||
image = tf.keras.utils.load_img(img_path, target_size=(224, 224))
|
||||
image_array = tf.keras.utils.img_to_array(image)
|
||||
image_array = tf.expand_dims(image_array, axis=0)
|
||||
|
||||
# Mendapatkan input dan output tensor dari model TFLite
|
||||
input_details = model_tflite.get_input_details()
|
||||
output_details = model_tflite.get_output_details()
|
||||
|
||||
# Menyiapkan input data untuk TFLite
|
||||
input_data = np.array(image_array, dtype=np.float32)
|
||||
model_tflite.set_tensor(input_details[0]['index'], input_data)
|
||||
|
||||
# Menjalankan inferensi
|
||||
model_tflite.invoke()
|
||||
|
||||
# Mengambil hasil output dari inferensi
|
||||
output_data = model_tflite.get_tensor(output_details[0]['index'])
|
||||
|
||||
# Prediksi
|
||||
predicted_index = np.argmax(output_data, axis=1)[0]
|
||||
predicted_class = classes[predicted_index] # Pastikan 'classes' sudah didefinisikan
|
||||
predicted_prob = output_data[0][predicted_index]
|
||||
|
||||
# Tampilkan hasil
|
||||
plt.imshow(image)
|
||||
plt.title(f"Prediksi: {predicted_class}; Probability: {predicted_prob:.2f}")
|
||||
plt.axis('off')
|
||||
plt.show()
|
||||
|
||||
# !pip install rembg
|
||||
# !pip install onnxruntime
|
||||
|
||||
# import tensorflow as tf
|
||||
# import numpy as np
|
||||
# import matplotlib.pyplot as plt
|
||||
# from rembg import remove
|
||||
# from PIL import Image
|
||||
# import io
|
||||
|
||||
# # Load Model
|
||||
# model = tf.keras.models.load_model('ResNet-50_tomato-leaf-disease_nobg.keras')
|
||||
|
||||
# # Kelas penyakit daun tomat
|
||||
# classes = [
|
||||
# 'bacterial_spot',
|
||||
# 'healthy',
|
||||
# 'late_blight',
|
||||
# 'leaf_curl_virus',
|
||||
# 'leaf_mold',
|
||||
# 'mosaic_virus',
|
||||
# 'septoria_leaf_spot'
|
||||
# ]
|
||||
|
||||
# # Load gambar dan hilangkan background
|
||||
# img_path = 'jamurdaun.jpeg'
|
||||
# with open(img_path, 'rb') as f:
|
||||
# input_image_bytes = f.read()
|
||||
|
||||
# output_image_bytes = remove(input_image_bytes)
|
||||
# image_no_bg = Image.open(io.BytesIO(output_image_bytes)).convert("RGB")
|
||||
# image_no_bg = image_no_bg.resize((224, 224))
|
||||
|
||||
# # Konversi gambar ke array untuk prediksi
|
||||
# image_array = tf.keras.utils.img_to_array(image_no_bg)
|
||||
# image_array = tf.expand_dims(image_array, axis=0)
|
||||
|
||||
# # Prediksi
|
||||
# predict = model.predict(image_array)
|
||||
# predicted_index = np.argmax(predict, axis=1)[0]
|
||||
# predicted_class = classes[predicted_index]
|
||||
# predicted_prob = predict[0][predicted_index]
|
||||
|
||||
# # Tampilkan hasil prediksi
|
||||
# plt.imshow(image_no_bg)
|
||||
# plt.title(f"Prediksi: {predicted_class}; Probability: {predicted_prob:.2f}")
|
||||
# plt.axis('off')
|
||||
# plt.show()
|
||||
|
||||
# !pip install tensorrt
|
||||
# !pip install tensorflowjs
|
||||
# !pip install TensorFlow==2.15.0
|
||||
# !pip install tensorflow-decision-forests==1.8.1
|
||||
|
||||
!pip uninstall -y tensorflow tensorflowjs
|
||||
!pip install tensorflow==2.15.0 tensorflowjs==4.9.0
|
||||
!pip install --upgrade jax==0.4.30
|
||||
|
||||
!tensorflowjs_converter --input_format=keras ResNet-50_tomato-leaf-disease.h5 ResNet-50_tomato-leaf-disease-tfjs
|
||||
|
||||
# import zipfile
|
||||
# import os
|
||||
|
||||
# def zip_folder(folder_path, output_zip_path):
|
||||
# """
|
||||
# Kompres sebuah folder menjadi file ZIP.
|
||||
|
||||
# Args:
|
||||
# folder_path (str): Path ke folder yang ingin dikompres.
|
||||
# output_zip_path (str): Path untuk output file ZIP.
|
||||
# """
|
||||
# with zipfile.ZipFile(output_zip_path, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
||||
# for root, dirs, files in os.walk(folder_path):
|
||||
# for file in files:
|
||||
# file_path = os.path.join(root, file)
|
||||
# zipf.write(file_path, os.path.relpath(file_path, folder_path))
|
||||
|
||||
# folder_to_zip = "ResNet-50_tomato-leaf-disease-tfjs_nobg"
|
||||
# output_zip_file = "ResNet-50_tomato-leaf-disease-tfjs_nobg.zip"
|
||||
# zip_folder(folder_to_zip, output_zip_file)
|
||||
# print(f"Folder '{folder_to_zip}' berhasil dikompres menjadi '{output_zip_file}'")
|
BIN
Model/ResNet-50_tomato-leaf-disease-tfjs.zip
Normal file
BIN
Model/ResNet-50_tomato-leaf-disease-tfjs.zip
Normal file
Binary file not shown.
BIN
Model/ResNet-50_tomato-leaf-disease.tflite
Normal file
BIN
Model/ResNet-50_tomato-leaf-disease.tflite
Normal file
Binary file not shown.
42
README.md
Normal file
42
README.md
Normal file
@ -0,0 +1,42 @@
|
||||
# TomatoLeafCare
|
||||
|
||||
This application is designed to detect diseases on tomato leaves using a CNN machine learning model with ResNet-50 architecture, specifically for Android devices.
|
||||
|
||||
## Table of Contents
|
||||
- [About the Project](#about-the-project)
|
||||
- [Features](#features)
|
||||
- [Technology Used](#technology-used)
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Contact](#contact)
|
||||
|
||||
## About the Project
|
||||
The **TomatoLeafCare** project aims to help anyone interested in growing tomatoes monitor the health of their tomato plants. This Android-based app makes it easy to identify common tomato leaf diseases by analyzing images uploaded by users. The app provides a quick diagnosis along with recommended treatments to help maintain the health and productivity of tomato plants.
|
||||
|
||||
## Features
|
||||
- **Disease Detection**: The app identifies various tomato leaf diseases based on images uploaded by users.
|
||||
- **Treatment Recommendations**: After detecting a disease, the app provides treatment advice to help users manage plant health effectively.
|
||||
|
||||
## Technology Used
|
||||
- **CNN** : Utilizes a CNN model with ResNet-50 architecture for accurate disease detection on tomato leaves.
|
||||
- **RAD Method** : The software development methodology used in this project.
|
||||
- **Android Studio** : The primary tool for developing Android applications.
|
||||
- **Kotlin** : The programming language used to create the application.
|
||||
|
||||
## Installation
|
||||
To install **TomatoLeafCare**, follow these steps:
|
||||
1. Clone the repository: `git clone https://github.com/yourusername/TomatoLeafCare.git`
|
||||
2. Open the project in Android Studio.
|
||||
3. Build and run the application on an Android emulator or physical device.
|
||||
|
||||
## Usage
|
||||
1. Launch the **TomatoLeafCare** app on your Android device.
|
||||
2. Capture or upload an image of a tomato leaf.
|
||||
3. Wait for the app to process the image.
|
||||
4. View the disease diagnosis and recommended treatments provided.
|
||||
|
||||
## Contact
|
||||
If you have any questions or suggestions, please contact:
|
||||
|
||||
**Name** : Ibnu Naz'm Ar-rosyid
|
||||
**Email** : ibnunazm.a11@gmail.com
|
63
Server/controllers/classificationController.js
Normal file
63
Server/controllers/classificationController.js
Normal file
@ -0,0 +1,63 @@
|
||||
const tf = require('@tensorflow/tfjs-node');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Path ke model
|
||||
const modelPath = path.join(
|
||||
__dirname,
|
||||
'../resources/ResNet-50_tomato-leaf-disease-tfjs_v8/model.json'
|
||||
);
|
||||
|
||||
let model;
|
||||
|
||||
// Fungsi untuk memuat model
|
||||
const loadModel = async () => {
|
||||
try {
|
||||
model = await tf.loadLayersModel(`file://${modelPath}`);
|
||||
console.log('Model loaded successfully.');
|
||||
} catch (err) {
|
||||
console.error('Error loading model:', err);
|
||||
throw new Error('Model loading failed.');
|
||||
}
|
||||
};
|
||||
|
||||
// Memuat model saat aplikasi dimulai
|
||||
loadModel();
|
||||
|
||||
const preprocessImage = async (imagePath) => {
|
||||
const imageBuffer = fs.readFileSync(imagePath);
|
||||
let tensor = tf.node.decodeImage(imageBuffer, 3);
|
||||
tensor = tf.image.resizeBilinear(tensor, [224, 224]);
|
||||
tensor = tensor.expandDims(0);
|
||||
//tensor = tensor.toFloat().div(tf.scalar(255.0));
|
||||
return tensor;
|
||||
};
|
||||
|
||||
// Fungsi untuk mengklasifikasikan gambar
|
||||
const classifyImage = async (imagePath) => {
|
||||
try {
|
||||
const classes = [
|
||||
'bacterial_spot',
|
||||
'healthy',
|
||||
'late_blight',
|
||||
'leaf_curl_virus',
|
||||
'leaf_mold',
|
||||
'mosaic_virus',
|
||||
'septoria_leaf_spot',
|
||||
];
|
||||
|
||||
const tensor = await preprocessImage(imagePath);
|
||||
const predictions = model.predict(tensor);
|
||||
const predictedClassIndex = predictions.argMax(-1).dataSync()[0];
|
||||
|
||||
// Ambil nama kelas berdasarkan indeks
|
||||
const predictedClassName = classes[predictedClassIndex];
|
||||
|
||||
return { index: predictedClassIndex, class: predictedClassName };
|
||||
} catch (err) {
|
||||
console.error('Error during classification:', err);
|
||||
throw new Error('Error during classification.');
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { classifyImage };
|
63
Server/controllers/classificationController.js.save
Normal file
63
Server/controllers/classificationController.js.save
Normal file
@ -0,0 +1,63 @@
|
||||
const tf = require('@tensorflow/tfjs-node');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Path ke model
|
||||
const modelPath = path.join(
|
||||
__dirname,
|
||||
'../resources/ResNet-50_tomato-leaf-disease-tfjs_v8/model.json'
|
||||
);
|
||||
|
||||
let model;
|
||||
|
||||
// Fungsi untuk memuat model
|
||||
const loadModel = async () => {
|
||||
try {
|
||||
model = await tf.loadLayersModel(`file://${modelPath}`);
|
||||
console.log('Model loaded successfully.');
|
||||
} catch (err) {
|
||||
console.error('Error loading model:', err);
|
||||
throw new Error('Model loading failed.');
|
||||
}
|
||||
};
|
||||
|
||||
// Memuat model saat aplikasi dimulai
|
||||
loadModel();
|
||||
|
||||
const preprocessImage = async (imagePath) => {
|
||||
const imageBuffer = fs.readFileSync(imagePath);
|
||||
let tensor = tf.node.decodeImage(imageBuffer, 3);
|
||||
tensor = tf.image.resizeBilinear(tensor, [224, 224]);
|
||||
tensor = tensor.expandDims(0);
|
||||
//tensor = tensor.toFloat().div(tf.scalar(255.0));
|
||||
return tensor;
|
||||
};
|
||||
|
||||
// Fungsi untuk mengklasifikasikan gambar
|
||||
const classifyImage = async (imagePath) => {
|
||||
try {
|
||||
const classes = [
|
||||
'bacterial_spot',
|
||||
'healthy',
|
||||
'late_blight',
|
||||
'leaf_curl_virus',
|
||||
'leaf_mold',
|
||||
'mosaic_virus',
|
||||
'septoria_leaf_spot',
|
||||
];
|
||||
|
||||
const tensor = await preprocessImage(imagePath);
|
||||
const predictions = model.predict(tensor);
|
||||
const predictedClassIndex = predictions.argMax(-1).dataSync()[0];
|
||||
|
||||
// Ambil nama kelas berdasarkan indeks
|
||||
const predictedClassName = classes[predictedClassIndex];
|
||||
|
||||
return { index: predictedClassIndex, class: predictedClassName };
|
||||
} catch (err) {
|
||||
console.error('Error during classification:', err);
|
||||
throw new Error('Error during classification.');
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { classifyImage };
|
61
Server/controllers/classificationController.js.save.1
Normal file
61
Server/controllers/classificationController.js.save.1
Normal file
@ -0,0 +1,61 @@
|
||||
const tf = require('@tensorflow/tfjs-node');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Path ke model
|
||||
const modelPath = path.join(
|
||||
__dirname,
|
||||
'../resources/ResNet-50_tomato-leaf-disease-tfjs_nobg/model.json'
|
||||
);
|
||||
|
||||
let model;
|
||||
|
||||
const loadModel = async () => {
|
||||
try {
|
||||
model = await tf.loadLayersModel(`file://${modelPath}`);
|
||||
console.log('Model loaded successfully.');
|
||||
} catch (err) {
|
||||
console.error('Error loading model:', err);
|
||||
throw new Error('Model loading failed.');
|
||||
}
|
||||
};
|
||||
|
||||
loadModel();
|
||||
|
||||
const preprocessImage = async (imagePath) => {
|
||||
const imageBuffer = fs.readFileSync(imagePath);
|
||||
let tensor = tf.node.decodeImage(imageBuffer, 3);
|
||||
tensor = tf.image.resizeBilinear(tensor, [224, 224]);
|
||||
tensor = tensor.expandDims(0);
|
||||
//tensor = tensor.toFloat().div(tf.scalar(255.0));
|
||||
return tensor;
|
||||
};
|
||||
|
||||
// Fungsi untuk mengklasifikasikan gambar
|
||||
const classifyImage = async (imagePath) => {
|
||||
try {
|
||||
const classes = [
|
||||
'bacterial_spot',
|
||||
'healthy',
|
||||
'late_blight',
|
||||
'leaf_curl_virus',
|
||||
'leaf_mold',
|
||||
'mosaic_virus',
|
||||
'septoria_leaf_spot',
|
||||
];
|
||||
|
||||
const tensor = await preprocessImage(imagePath);
|
||||
const predictions = model.predict(tensor);
|
||||
const predictedClassIndex = predictions.argMax(-1).dataSync()[0];
|
||||
|
||||
// Ambil nama kelas berdasarkan indeks
|
||||
const predictedClassName = classes[predictedClassIndex];
|
||||
|
||||
return { index: predictedClassIndex, class: predictedClassName };
|
||||
} catch (err) {
|
||||
console.error('Error during classification:', err);
|
||||
throw new Error('Error during classification.');
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { classifyImage };
|
23
Server/middleware/authMiddleware.js
Normal file
23
Server/middleware/authMiddleware.js
Normal file
@ -0,0 +1,23 @@
|
||||
function basicAuth(req, res, next) {
|
||||
const authHeader = req.headers['authorization'];
|
||||
|
||||
if (!authHeader || !authHeader.startsWith('Basic ')) {
|
||||
res.setHeader('WWW-Authenticate', 'Basic');
|
||||
return res.status(401).send('Authentication required.');
|
||||
}
|
||||
|
||||
const base64Credentials = authHeader.split(' ')[1];
|
||||
const credentials = Buffer.from(base64Credentials, 'base64').toString('ascii');
|
||||
const [username, password] = credentials.split(':');
|
||||
|
||||
const USERNAME = 'rahasia';
|
||||
const PASSWORD = 'tomat';
|
||||
|
||||
if (username === USERNAME && password === PASSWORD) {
|
||||
next();
|
||||
} else {
|
||||
return res.status(403).send('Access denied.');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = basicAuth;
|
18
Server/package.json
Normal file
18
Server/package.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@tensorflow/tfjs-node": "^4.8.0",
|
||||
"express": "^4.21.2",
|
||||
"multer": "^1.4.5-lts.1"
|
||||
},
|
||||
"name": "tomato_leaf_care",
|
||||
"version": "1.0.0",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node server.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"description": ""
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
13
Server/routes/checkRoute.js
Normal file
13
Server/routes/checkRoute.js
Normal file
@ -0,0 +1,13 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/check', (req, res) => {
|
||||
res.status(200).json({
|
||||
status: 'ok',
|
||||
message: 'Server is up and running',
|
||||
timestamp: new Date().toISOString()
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
31
Server/routes/classificationRoute.js
Normal file
31
Server/routes/classificationRoute.js
Normal file
@ -0,0 +1,31 @@
|
||||
const express = require('express');
|
||||
const multer = require('multer');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { classifyImage } = require('../controllers/classificationController');
|
||||
|
||||
const router = express.Router();
|
||||
const upload = multer({ dest: 'uploads/' });
|
||||
|
||||
router.post('/classify', upload.single('image'), async (req, res) => {
|
||||
try {
|
||||
if (!req.file) {
|
||||
return res.status(400).json({ error: 'No image file uploaded' });
|
||||
}
|
||||
|
||||
const imagePath = path.join(__dirname, `../${req.file.path}`);
|
||||
const predictedClass = await classifyImage(imagePath);
|
||||
|
||||
fs.unlinkSync(imagePath);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
predictedClass,
|
||||
});
|
||||
} catch (err) {
|
||||
res.status(500).json({ error: err.message });
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
28
Server/server.js
Normal file
28
Server/server.js
Normal file
@ -0,0 +1,28 @@
|
||||
const express = require("express");
|
||||
const fs = require("fs");
|
||||
const https = require("https");
|
||||
|
||||
const basicAuth = require("./middleware/authMiddleware")
|
||||
const classificationRoutes = require("./routes/classificationRoute");
|
||||
const checkRoutes = require("./routes/checkRoute");
|
||||
|
||||
const app = express();
|
||||
const port = 8000;
|
||||
|
||||
//const sslOptions = {
|
||||
// key: fs.readFileSync("./ssl/server.key"),
|
||||
// cert: fs.readFileSync("./ssl/server.crt")
|
||||
//};
|
||||
|
||||
app.use("/tomatoleafcare", basicAuth, classificationRoutes);
|
||||
app.use("/tomatoleafcare", basicAuth, checkRoutes);
|
||||
|
||||
//https.createServer(sslOptions, app).listen(port, () => {
|
||||
// console.log(`HTTPS Server is running on port ${port}...`);
|
||||
//});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server running on http://localhost:${port}`);
|
||||
});
|
||||
|
||||
|
BIN
TomatoLeafCare/.gradle/8.6/checksums/checksums.lock
Normal file
BIN
TomatoLeafCare/.gradle/8.6/checksums/checksums.lock
Normal file
Binary file not shown.
BIN
TomatoLeafCare/.gradle/8.6/checksums/md5-checksums.bin
Normal file
BIN
TomatoLeafCare/.gradle/8.6/checksums/md5-checksums.bin
Normal file
Binary file not shown.
BIN
TomatoLeafCare/.gradle/8.6/checksums/sha1-checksums.bin
Normal file
BIN
TomatoLeafCare/.gradle/8.6/checksums/sha1-checksums.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
<EFBFBD>axfnd7xox5e4ton7ncyqiattau<EFBFBD><02>classesP=+<2B>7<EFBFBD><37>7<EFBFBD><37>7~n<>`<60><>sourcesI<>iH<69>垢<EFBFBD>H{<7B><>&<26>
|
@ -0,0 +1,501 @@
|
||||
package org.gradle.accessors.dm;
|
||||
|
||||
import org.gradle.api.NonNullApi;
|
||||
import org.gradle.api.artifacts.MinimalExternalModuleDependency;
|
||||
import org.gradle.plugin.use.PluginDependency;
|
||||
import org.gradle.api.artifacts.ExternalModuleDependencyBundle;
|
||||
import org.gradle.api.artifacts.MutableVersionConstraint;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.model.ObjectFactory;
|
||||
import org.gradle.api.provider.ProviderFactory;
|
||||
import org.gradle.api.internal.catalog.AbstractExternalDependencyFactory;
|
||||
import org.gradle.api.internal.catalog.DefaultVersionCatalog;
|
||||
import java.util.Map;
|
||||
import org.gradle.api.internal.attributes.ImmutableAttributesFactory;
|
||||
import org.gradle.api.internal.artifacts.dsl.CapabilityNotationParser;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* A catalog of dependencies accessible via the {@code libs} extension.
|
||||
*/
|
||||
@NonNullApi
|
||||
public class LibrariesForLibs extends AbstractExternalDependencyFactory {
|
||||
|
||||
private final AbstractExternalDependencyFactory owner = this;
|
||||
private final AndroidxLibraryAccessors laccForAndroidxLibraryAccessors = new AndroidxLibraryAccessors(owner);
|
||||
private final VersionAccessors vaccForVersionAccessors = new VersionAccessors(providers, config);
|
||||
private final BundleAccessors baccForBundleAccessors = new BundleAccessors(objects, providers, config, attributesFactory, capabilityNotationParser);
|
||||
private final PluginAccessors paccForPluginAccessors = new PluginAccessors(providers, config);
|
||||
|
||||
@Inject
|
||||
public LibrariesForLibs(DefaultVersionCatalog config, ProviderFactory providers, ObjectFactory objects, ImmutableAttributesFactory attributesFactory, CapabilityNotationParser capabilityNotationParser) {
|
||||
super(config, providers, objects, attributesFactory, capabilityNotationParser);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>junit</b> with <b>junit:junit</b> coordinates and
|
||||
* with version reference <b>junit</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getJunit() {
|
||||
return create("junit");
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx</b>
|
||||
*/
|
||||
public AndroidxLibraryAccessors getAndroidx() {
|
||||
return laccForAndroidxLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of versions at <b>versions</b>
|
||||
*/
|
||||
public VersionAccessors getVersions() {
|
||||
return vaccForVersionAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of bundles at <b>bundles</b>
|
||||
*/
|
||||
public BundleAccessors getBundles() {
|
||||
return baccForBundleAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of plugins at <b>plugins</b>
|
||||
*/
|
||||
public PluginAccessors getPlugins() {
|
||||
return paccForPluginAccessors;
|
||||
}
|
||||
|
||||
public static class AndroidxLibraryAccessors extends SubDependencyFactory {
|
||||
private final AndroidxActivityLibraryAccessors laccForAndroidxActivityLibraryAccessors = new AndroidxActivityLibraryAccessors(owner);
|
||||
private final AndroidxComposeLibraryAccessors laccForAndroidxComposeLibraryAccessors = new AndroidxComposeLibraryAccessors(owner);
|
||||
private final AndroidxCoreLibraryAccessors laccForAndroidxCoreLibraryAccessors = new AndroidxCoreLibraryAccessors(owner);
|
||||
private final AndroidxEspressoLibraryAccessors laccForAndroidxEspressoLibraryAccessors = new AndroidxEspressoLibraryAccessors(owner);
|
||||
private final AndroidxLifecycleLibraryAccessors laccForAndroidxLifecycleLibraryAccessors = new AndroidxLifecycleLibraryAccessors(owner);
|
||||
private final AndroidxUiLibraryAccessors laccForAndroidxUiLibraryAccessors = new AndroidxUiLibraryAccessors(owner);
|
||||
|
||||
public AndroidxLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>junit</b> with <b>androidx.test.ext:junit</b> coordinates and
|
||||
* with version reference <b>junitVersion</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getJunit() {
|
||||
return create("androidx.junit");
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>material3</b> with <b>androidx.compose.material3:material3</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getMaterial3() {
|
||||
return create("androidx.material3");
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.activity</b>
|
||||
*/
|
||||
public AndroidxActivityLibraryAccessors getActivity() {
|
||||
return laccForAndroidxActivityLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.compose</b>
|
||||
*/
|
||||
public AndroidxComposeLibraryAccessors getCompose() {
|
||||
return laccForAndroidxComposeLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.core</b>
|
||||
*/
|
||||
public AndroidxCoreLibraryAccessors getCore() {
|
||||
return laccForAndroidxCoreLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.espresso</b>
|
||||
*/
|
||||
public AndroidxEspressoLibraryAccessors getEspresso() {
|
||||
return laccForAndroidxEspressoLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.lifecycle</b>
|
||||
*/
|
||||
public AndroidxLifecycleLibraryAccessors getLifecycle() {
|
||||
return laccForAndroidxLifecycleLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.ui</b>
|
||||
*/
|
||||
public AndroidxUiLibraryAccessors getUi() {
|
||||
return laccForAndroidxUiLibraryAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidxActivityLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxActivityLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>compose</b> with <b>androidx.activity:activity-compose</b> coordinates and
|
||||
* with version reference <b>activityCompose</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getCompose() {
|
||||
return create("androidx.activity.compose");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidxComposeLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxComposeLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>bom</b> with <b>androidx.compose:compose-bom</b> coordinates and
|
||||
* with version reference <b>composeBom</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getBom() {
|
||||
return create("androidx.compose.bom");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidxCoreLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxCoreLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>ktx</b> with <b>androidx.core:core-ktx</b> coordinates and
|
||||
* with version reference <b>coreKtx</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getKtx() {
|
||||
return create("androidx.core.ktx");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidxEspressoLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxEspressoLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>core</b> with <b>androidx.test.espresso:espresso-core</b> coordinates and
|
||||
* with version reference <b>espressoCore</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getCore() {
|
||||
return create("androidx.espresso.core");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidxLifecycleLibraryAccessors extends SubDependencyFactory {
|
||||
private final AndroidxLifecycleRuntimeLibraryAccessors laccForAndroidxLifecycleRuntimeLibraryAccessors = new AndroidxLifecycleRuntimeLibraryAccessors(owner);
|
||||
|
||||
public AndroidxLifecycleLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.lifecycle.runtime</b>
|
||||
*/
|
||||
public AndroidxLifecycleRuntimeLibraryAccessors getRuntime() {
|
||||
return laccForAndroidxLifecycleRuntimeLibraryAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidxLifecycleRuntimeLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxLifecycleRuntimeLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>ktx</b> with <b>androidx.lifecycle:lifecycle-runtime-ktx</b> coordinates and
|
||||
* with version reference <b>lifecycleRuntimeKtx</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getKtx() {
|
||||
return create("androidx.lifecycle.runtime.ktx");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidxUiLibraryAccessors extends SubDependencyFactory implements DependencyNotationSupplier {
|
||||
private final AndroidxUiTestLibraryAccessors laccForAndroidxUiTestLibraryAccessors = new AndroidxUiTestLibraryAccessors(owner);
|
||||
private final AndroidxUiToolingLibraryAccessors laccForAndroidxUiToolingLibraryAccessors = new AndroidxUiToolingLibraryAccessors(owner);
|
||||
|
||||
public AndroidxUiLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>ui</b> with <b>androidx.compose.ui:ui</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> asProvider() {
|
||||
return create("androidx.ui");
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>graphics</b> with <b>androidx.compose.ui:ui-graphics</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getGraphics() {
|
||||
return create("androidx.ui.graphics");
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.ui.test</b>
|
||||
*/
|
||||
public AndroidxUiTestLibraryAccessors getTest() {
|
||||
return laccForAndroidxUiTestLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.ui.tooling</b>
|
||||
*/
|
||||
public AndroidxUiToolingLibraryAccessors getTooling() {
|
||||
return laccForAndroidxUiToolingLibraryAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidxUiTestLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxUiTestLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>junit4</b> with <b>androidx.compose.ui:ui-test-junit4</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getJunit4() {
|
||||
return create("androidx.ui.test.junit4");
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>manifest</b> with <b>androidx.compose.ui:ui-test-manifest</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getManifest() {
|
||||
return create("androidx.ui.test.manifest");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidxUiToolingLibraryAccessors extends SubDependencyFactory implements DependencyNotationSupplier {
|
||||
|
||||
public AndroidxUiToolingLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>tooling</b> with <b>androidx.compose.ui:ui-tooling</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> asProvider() {
|
||||
return create("androidx.ui.tooling");
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>preview</b> with <b>androidx.compose.ui:ui-tooling-preview</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<MinimalExternalModuleDependency> getPreview() {
|
||||
return create("androidx.ui.tooling.preview");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class VersionAccessors extends VersionFactory {
|
||||
|
||||
public VersionAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Version alias <b>activityCompose</b> with value <b>1.10.1</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getActivityCompose() { return getVersion("activityCompose"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>agp</b> with value <b>8.4.0</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getAgp() { return getVersion("agp"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>composeBom</b> with value <b>2023.08.00</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getComposeBom() { return getVersion("composeBom"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>coreKtx</b> with value <b>1.15.0</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getCoreKtx() { return getVersion("coreKtx"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>espressoCore</b> with value <b>3.6.1</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getEspressoCore() { return getVersion("espressoCore"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>junit</b> with value <b>4.13.2</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getJunit() { return getVersion("junit"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>junitVersion</b> with value <b>1.2.1</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getJunitVersion() { return getVersion("junitVersion"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>kotlin</b> with value <b>1.9.0</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getKotlin() { return getVersion("kotlin"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>lifecycleRuntimeKtx</b> with value <b>2.8.7</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getLifecycleRuntimeKtx() { return getVersion("lifecycleRuntimeKtx"); }
|
||||
|
||||
}
|
||||
|
||||
public static class BundleAccessors extends BundleFactory {
|
||||
|
||||
public BundleAccessors(ObjectFactory objects, ProviderFactory providers, DefaultVersionCatalog config, ImmutableAttributesFactory attributesFactory, CapabilityNotationParser capabilityNotationParser) { super(objects, providers, config, attributesFactory, capabilityNotationParser); }
|
||||
|
||||
}
|
||||
|
||||
public static class PluginAccessors extends PluginFactory {
|
||||
private final AndroidPluginAccessors paccForAndroidPluginAccessors = new AndroidPluginAccessors(providers, config);
|
||||
private final JetbrainsPluginAccessors paccForJetbrainsPluginAccessors = new JetbrainsPluginAccessors(providers, config);
|
||||
|
||||
public PluginAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Group of plugins at <b>plugins.android</b>
|
||||
*/
|
||||
public AndroidPluginAccessors getAndroid() {
|
||||
return paccForAndroidPluginAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of plugins at <b>plugins.jetbrains</b>
|
||||
*/
|
||||
public JetbrainsPluginAccessors getJetbrains() {
|
||||
return paccForJetbrainsPluginAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidPluginAccessors extends PluginFactory {
|
||||
|
||||
public AndroidPluginAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Plugin provider for <b>android.application</b> with plugin id <b>com.android.application</b> and
|
||||
* with version reference <b>agp</b>
|
||||
* <p>
|
||||
* This plugin was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<PluginDependency> getApplication() { return createPlugin("android.application"); }
|
||||
|
||||
}
|
||||
|
||||
public static class JetbrainsPluginAccessors extends PluginFactory {
|
||||
private final JetbrainsKotlinPluginAccessors paccForJetbrainsKotlinPluginAccessors = new JetbrainsKotlinPluginAccessors(providers, config);
|
||||
|
||||
public JetbrainsPluginAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Group of plugins at <b>plugins.jetbrains.kotlin</b>
|
||||
*/
|
||||
public JetbrainsKotlinPluginAccessors getKotlin() {
|
||||
return paccForJetbrainsKotlinPluginAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class JetbrainsKotlinPluginAccessors extends PluginFactory {
|
||||
|
||||
public JetbrainsKotlinPluginAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Plugin provider for <b>jetbrains.kotlin.android</b> with plugin id <b>org.jetbrains.kotlin.android</b> and
|
||||
* with version reference <b>kotlin</b>
|
||||
* <p>
|
||||
* This plugin was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<PluginDependency> getAndroid() { return createPlugin("jetbrains.kotlin.android"); }
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,645 @@
|
||||
package org.gradle.accessors.dm;
|
||||
|
||||
import org.gradle.api.NonNullApi;
|
||||
import org.gradle.api.artifacts.MinimalExternalModuleDependency;
|
||||
import org.gradle.plugin.use.PluginDependency;
|
||||
import org.gradle.api.artifacts.ExternalModuleDependencyBundle;
|
||||
import org.gradle.api.artifacts.MutableVersionConstraint;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.model.ObjectFactory;
|
||||
import org.gradle.api.provider.ProviderFactory;
|
||||
import org.gradle.api.internal.catalog.AbstractExternalDependencyFactory;
|
||||
import org.gradle.api.internal.catalog.DefaultVersionCatalog;
|
||||
import java.util.Map;
|
||||
import org.gradle.api.internal.attributes.ImmutableAttributesFactory;
|
||||
import org.gradle.api.internal.artifacts.dsl.CapabilityNotationParser;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* A catalog of dependencies accessible via the {@code libs} extension.
|
||||
*/
|
||||
@NonNullApi
|
||||
public class LibrariesForLibsInPluginsBlock extends AbstractExternalDependencyFactory {
|
||||
|
||||
private final AbstractExternalDependencyFactory owner = this;
|
||||
private final AndroidxLibraryAccessors laccForAndroidxLibraryAccessors = new AndroidxLibraryAccessors(owner);
|
||||
private final VersionAccessors vaccForVersionAccessors = new VersionAccessors(providers, config);
|
||||
private final BundleAccessors baccForBundleAccessors = new BundleAccessors(objects, providers, config, attributesFactory, capabilityNotationParser);
|
||||
private final PluginAccessors paccForPluginAccessors = new PluginAccessors(providers, config);
|
||||
|
||||
@Inject
|
||||
public LibrariesForLibsInPluginsBlock(DefaultVersionCatalog config, ProviderFactory providers, ObjectFactory objects, ImmutableAttributesFactory attributesFactory, CapabilityNotationParser capabilityNotationParser) {
|
||||
super(config, providers, objects, attributesFactory, capabilityNotationParser);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>junit</b> with <b>junit:junit</b> coordinates and
|
||||
* with version reference <b>junit</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getJunit() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("junit");
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxLibraryAccessors getAndroidx() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of versions at <b>versions</b>
|
||||
*/
|
||||
public VersionAccessors getVersions() {
|
||||
return vaccForVersionAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of bundles at <b>bundles</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public BundleAccessors getBundles() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return baccForBundleAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of plugins at <b>plugins</b>
|
||||
*/
|
||||
public PluginAccessors getPlugins() {
|
||||
return paccForPluginAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxLibraryAccessors extends SubDependencyFactory {
|
||||
private final AndroidxActivityLibraryAccessors laccForAndroidxActivityLibraryAccessors = new AndroidxActivityLibraryAccessors(owner);
|
||||
private final AndroidxComposeLibraryAccessors laccForAndroidxComposeLibraryAccessors = new AndroidxComposeLibraryAccessors(owner);
|
||||
private final AndroidxCoreLibraryAccessors laccForAndroidxCoreLibraryAccessors = new AndroidxCoreLibraryAccessors(owner);
|
||||
private final AndroidxEspressoLibraryAccessors laccForAndroidxEspressoLibraryAccessors = new AndroidxEspressoLibraryAccessors(owner);
|
||||
private final AndroidxLifecycleLibraryAccessors laccForAndroidxLifecycleLibraryAccessors = new AndroidxLifecycleLibraryAccessors(owner);
|
||||
private final AndroidxUiLibraryAccessors laccForAndroidxUiLibraryAccessors = new AndroidxUiLibraryAccessors(owner);
|
||||
|
||||
public AndroidxLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>junit</b> with <b>androidx.test.ext:junit</b> coordinates and
|
||||
* with version reference <b>junitVersion</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getJunit() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.junit");
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>material3</b> with <b>androidx.compose.material3:material3</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getMaterial3() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.material3");
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.activity</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxActivityLibraryAccessors getActivity() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxActivityLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.compose</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxComposeLibraryAccessors getCompose() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxComposeLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.core</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxCoreLibraryAccessors getCore() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxCoreLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.espresso</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxEspressoLibraryAccessors getEspresso() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxEspressoLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.lifecycle</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxLifecycleLibraryAccessors getLifecycle() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxLifecycleLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.ui</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxUiLibraryAccessors getUi() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxUiLibraryAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxActivityLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxActivityLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>compose</b> with <b>androidx.activity:activity-compose</b> coordinates and
|
||||
* with version reference <b>activityCompose</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getCompose() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.activity.compose");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxComposeLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxComposeLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>bom</b> with <b>androidx.compose:compose-bom</b> coordinates and
|
||||
* with version reference <b>composeBom</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getBom() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.compose.bom");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxCoreLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxCoreLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>ktx</b> with <b>androidx.core:core-ktx</b> coordinates and
|
||||
* with version reference <b>coreKtx</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getKtx() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.core.ktx");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxEspressoLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxEspressoLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>core</b> with <b>androidx.test.espresso:espresso-core</b> coordinates and
|
||||
* with version reference <b>espressoCore</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getCore() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.espresso.core");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxLifecycleLibraryAccessors extends SubDependencyFactory {
|
||||
private final AndroidxLifecycleRuntimeLibraryAccessors laccForAndroidxLifecycleRuntimeLibraryAccessors = new AndroidxLifecycleRuntimeLibraryAccessors(owner);
|
||||
|
||||
public AndroidxLifecycleLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.lifecycle.runtime</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxLifecycleRuntimeLibraryAccessors getRuntime() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxLifecycleRuntimeLibraryAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxLifecycleRuntimeLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxLifecycleRuntimeLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>ktx</b> with <b>androidx.lifecycle:lifecycle-runtime-ktx</b> coordinates and
|
||||
* with version reference <b>lifecycleRuntimeKtx</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getKtx() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.lifecycle.runtime.ktx");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxUiLibraryAccessors extends SubDependencyFactory implements DependencyNotationSupplier {
|
||||
private final AndroidxUiTestLibraryAccessors laccForAndroidxUiTestLibraryAccessors = new AndroidxUiTestLibraryAccessors(owner);
|
||||
private final AndroidxUiToolingLibraryAccessors laccForAndroidxUiToolingLibraryAccessors = new AndroidxUiToolingLibraryAccessors(owner);
|
||||
|
||||
public AndroidxUiLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>ui</b> with <b>androidx.compose.ui:ui</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> asProvider() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.ui");
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>graphics</b> with <b>androidx.compose.ui:ui-graphics</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getGraphics() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.ui.graphics");
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.ui.test</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxUiTestLibraryAccessors getTest() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxUiTestLibraryAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of libraries at <b>androidx.ui.tooling</b>
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public AndroidxUiToolingLibraryAccessors getTooling() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return laccForAndroidxUiToolingLibraryAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxUiTestLibraryAccessors extends SubDependencyFactory {
|
||||
|
||||
public AndroidxUiTestLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>junit4</b> with <b>androidx.compose.ui:ui-test-junit4</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getJunit4() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.ui.test.junit4");
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>manifest</b> with <b>androidx.compose.ui:ui-test-manifest</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getManifest() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.ui.test.manifest");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AndroidxUiToolingLibraryAccessors extends SubDependencyFactory implements DependencyNotationSupplier {
|
||||
|
||||
public AndroidxUiToolingLibraryAccessors(AbstractExternalDependencyFactory owner) { super(owner); }
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>tooling</b> with <b>androidx.compose.ui:ui-tooling</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> asProvider() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.ui.tooling");
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependency provider for <b>preview</b> with <b>androidx.compose.ui:ui-tooling-preview</b> coordinates and
|
||||
* with <b>no version specified</b>
|
||||
* <p>
|
||||
* This dependency was declared in catalog libs.versions.toml
|
||||
*
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public Provider<MinimalExternalModuleDependency> getPreview() {
|
||||
org.gradle.internal.deprecation.DeprecationLogger.deprecateBehaviour("Accessing libraries or bundles from version catalogs in the plugins block.").withAdvice("Only use versions or plugins from catalogs in the plugins block.").willBeRemovedInGradle9().withUpgradeGuideSection(8, "kotlin_dsl_deprecated_catalogs_plugins_block").nagUser();
|
||||
return create("androidx.ui.tooling.preview");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class VersionAccessors extends VersionFactory {
|
||||
|
||||
public VersionAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Version alias <b>activityCompose</b> with value <b>1.10.1</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getActivityCompose() { return getVersion("activityCompose"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>agp</b> with value <b>8.4.0</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getAgp() { return getVersion("agp"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>composeBom</b> with value <b>2023.08.00</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getComposeBom() { return getVersion("composeBom"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>coreKtx</b> with value <b>1.15.0</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getCoreKtx() { return getVersion("coreKtx"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>espressoCore</b> with value <b>3.6.1</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getEspressoCore() { return getVersion("espressoCore"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>junit</b> with value <b>4.13.2</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getJunit() { return getVersion("junit"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>junitVersion</b> with value <b>1.2.1</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getJunitVersion() { return getVersion("junitVersion"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>kotlin</b> with value <b>1.9.0</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getKotlin() { return getVersion("kotlin"); }
|
||||
|
||||
/**
|
||||
* Version alias <b>lifecycleRuntimeKtx</b> with value <b>2.8.7</b>
|
||||
* <p>
|
||||
* If the version is a rich version and cannot be represented as a
|
||||
* single version string, an empty string is returned.
|
||||
* <p>
|
||||
* This version was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<String> getLifecycleRuntimeKtx() { return getVersion("lifecycleRuntimeKtx"); }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in Gradle 9.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class BundleAccessors extends BundleFactory {
|
||||
|
||||
public BundleAccessors(ObjectFactory objects, ProviderFactory providers, DefaultVersionCatalog config, ImmutableAttributesFactory attributesFactory, CapabilityNotationParser capabilityNotationParser) { super(objects, providers, config, attributesFactory, capabilityNotationParser); }
|
||||
|
||||
}
|
||||
|
||||
public static class PluginAccessors extends PluginFactory {
|
||||
private final AndroidPluginAccessors paccForAndroidPluginAccessors = new AndroidPluginAccessors(providers, config);
|
||||
private final JetbrainsPluginAccessors paccForJetbrainsPluginAccessors = new JetbrainsPluginAccessors(providers, config);
|
||||
|
||||
public PluginAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Group of plugins at <b>plugins.android</b>
|
||||
*/
|
||||
public AndroidPluginAccessors getAndroid() {
|
||||
return paccForAndroidPluginAccessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group of plugins at <b>plugins.jetbrains</b>
|
||||
*/
|
||||
public JetbrainsPluginAccessors getJetbrains() {
|
||||
return paccForJetbrainsPluginAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AndroidPluginAccessors extends PluginFactory {
|
||||
|
||||
public AndroidPluginAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Plugin provider for <b>android.application</b> with plugin id <b>com.android.application</b> and
|
||||
* with version reference <b>agp</b>
|
||||
* <p>
|
||||
* This plugin was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<PluginDependency> getApplication() { return createPlugin("android.application"); }
|
||||
|
||||
}
|
||||
|
||||
public static class JetbrainsPluginAccessors extends PluginFactory {
|
||||
private final JetbrainsKotlinPluginAccessors paccForJetbrainsKotlinPluginAccessors = new JetbrainsKotlinPluginAccessors(providers, config);
|
||||
|
||||
public JetbrainsPluginAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Group of plugins at <b>plugins.jetbrains.kotlin</b>
|
||||
*/
|
||||
public JetbrainsKotlinPluginAccessors getKotlin() {
|
||||
return paccForJetbrainsKotlinPluginAccessors;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class JetbrainsKotlinPluginAccessors extends PluginFactory {
|
||||
|
||||
public JetbrainsKotlinPluginAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }
|
||||
|
||||
/**
|
||||
* Plugin provider for <b>jetbrains.kotlin.android</b> with plugin id <b>org.jetbrains.kotlin.android</b> and
|
||||
* with version reference <b>kotlin</b>
|
||||
* <p>
|
||||
* This plugin was declared in catalog libs.versions.toml
|
||||
*/
|
||||
public Provider<PluginDependency> getAndroid() { return createPlugin("jetbrains.kotlin.android"); }
|
||||
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user