Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Flujo de trabajo para construir el código al hacer push o pull_request en la rama desarrollo
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Integración continua con Gradle (gradlew)

on:
push:
branches: [ desarrollo ]
pull_request:
branches: [ desarrollo ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
- name: Dar permisos a gradlew
run: chmod +x gradlew
- name: Construir el código con gradlew
run: ./gradlew build
1 change: 1 addition & 0 deletions DEVELOPERS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sindre L. Øyen
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Librería con capacidades que den soporte al desarrollo de aplicaciones para la

## [Página en gitHub Pages](https://mit-fs.github.io/Audit4Improve-API/)


Soy el usuario CHR8486.
26 changes: 13 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'

//A�ado el plugin para eclipse
//Anado el plugin para eclipse
id 'eclipse'
//para poder publicar paquetes en github
id 'maven-publish'
//Plugin para an�lisis est�tico de c�digo
//Plugin para analisis estetico de codigo
id "nebula.lint" version "17.7.0"
}
version = '0.0'
tasks.withType(JavaCompile) {
//A�adir la opci�n Xlint
//Anadir la opcion Xlint
options.deprecation = true
options.encoding = 'ISO-8859-1'
}

tasks.withType(Javadoc){

description = "Genera la documentaci�n"
//indicar que la codificaci�n es ISO
description = "Generates the documentation"
//indicar que la codificacion es ISO
options.encoding = 'ISO-8859-1'
options.charSet = 'ISO-8859-1'
options.author = true
Expand Down Expand Up @@ -59,16 +59,16 @@ repositories {
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
//A�ado la dependencia de la librer�a github que vamos a usar
//Anado la dependencia de la libreria github que vamos a usar

// https://mvnrepository.com/artifact/org.kohsuke/github-api
//JAVADOC: https://github-api.kohsuke.org/apidocs/index.html
implementation group: 'org.kohsuke', name: 'github-api', version: '1.301'
api 'org.kohsuke:github-api:1.301'
//Para la persistencia de informes usaremos la api apachepoi
// https://mvnrepository.com/artifact/org.apache.poi/poi
//JAVADOC: https://poi.apache.org/apidocs/5.0/
implementation 'org.apache.poi:poi:5.2.1'
//Para leer la configuraci�n como ficheros con datos en formato json
//Para leer la configuracion como ficheros con datos en formato json
// https://mvnrepository.com/artifact/javax.json/javax.json-api
//JAVADOC: https://javadoc.io/doc/org.glassfish/javax.json/latest/overview-summary.html
implementation group: 'javax.json', name: 'javax.json-api', version: '1.1.4'
Expand All @@ -80,16 +80,16 @@ dependencies {

// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:30.1.1-jre'
//A�ado para usar mockito
//Anado para usar mockito
//JAVADOC: https://javadoc.io/doc/org.mockito/mockito-core/4.3.1/overview-summary.html
testImplementation 'org.mockito:mockito-core:4.3.1'
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
//JAVADOC: https://javadoc.io/doc/org.mockito/mockito-junit-jupiter/latest/index.html
testImplementation 'org.mockito:mockito-junit-jupiter:4.3.1'

testImplementation(platform('org.junit:junit-bom:5.8.2'))
//JAVADOC: https://www.javadoc.io/doc/org.junit.jupiter/junit-jupiter-api/latest/index.html
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation(platform('org.junit:junit-bom:5.8.2'))
//JAVADOC: https://www.javadoc.io/doc/org.junit.jupiter/junit-jupiter-api/latest/index.html
testImplementation('org.junit.jupiter:junit-jupiter')

}

Expand All @@ -109,7 +109,7 @@ publishing {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/mit-fs/audit4improve-api")
credentials {
//las propiedades gpr.user y gpr.key est�n configuradas en gradle.properties en el raiz del proyecto, y se a�ade a .gitignore para que no se suban
//las propiedades gpr.user y gpr.key estan configuradas en gradle.properties en el raiz del proyecto, y se anade a .gitignore para que no se suban
//O bien configuro las variables de entorno GITHUB_LOGIN y GITHUB_PACKAGES
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_LOGIN")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_PACKAGES")
Expand Down
33 changes: 21 additions & 12 deletions src/test/java/us/muit/fs/a4i/test/control/SupervisorControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@
import java.util.logging.*;

/**
* @author Isabel Rom�n Mart�nez
* @author Isabel Rom�n Mart�nez
* @version 0.0
* Esta clase se crea para poder probar algunas de las capacidades que ofrece la api github
* Ser� descartada posteriormente
* No usa Junit, sino que crea un main, no tiene verificaciones autom�ticas, la automatizaci�n no es posible
* Ser� descartada posteriormente
* No usa Junit, sino que crea un main, no tiene verificaciones autom�ticas, la automatizaci�n no es posible
*
*/
public class SupervisorControl {
private static void divider() {
System.out.println("------------------------------------------------------");
}

private static Logger log=Logger.getLogger(SupervisorControl.class.getName());
/**
* @param args
*/
public static void main(String[] args) {
System.out.println(""); divider();
try {
GitHub github = GitHubBuilder.fromEnvironment().build();
GHMyself myinfo=github.getMyself();
Expand All @@ -28,7 +33,7 @@ public static void main(String[] args) {
PagedIterable<GHRepository> myOwnRepos=myinfo.listRepositories(10, GHMyself.RepositoryListFilter.OWNER);
int count=1;
for(GHRepository repo:myOwnRepos.toList()) {
System.out.println("Nombre de mi repositorio n�mero "+count+" "+repo.getFullName());
System.out.println("Nombre de mi repositorio numero "+count+" "+repo.getFullName());
List<GHProject> proyectos=repo.listProjects().toList();
int i=1;
for(GHProject project:proyectos){
Expand All @@ -42,48 +47,52 @@ public static void main(String[] args) {
}
count++;
}
divider();
System.out.println("Numero de repositorios "+myOwnRepos.toList().size());
divider(); System.out.println("");

GHPersonSet<GHOrganization> misOrganizaciones = myinfo.getAllOrganizations();
System.out.println("Pertenezco a las siguientes organizaciones: ");
//Iterator<GHOrganization> iteradorOrganizaciones = misOrganizaciones.iterator();
int i=1;
for(GHOrganization organizacion: misOrganizaciones) {
System.out.println(i+" Organizaci�n "+organizacion.getId()+" : "+organizacion);
System.out.println(i+" Organizacion "+organizacion.getId()+" : "+organizacion);
PagedIterable<GHRepository> repos=organizacion.listRepositories();
System.out.println(repos);
i++;
}
/*
log.info("Mis datos "+myinfo);
log.info("Un repositorio "+unrepo);
log.info("N�mero de repositorios "+myrepos.toList().size());
log.info("Numero de repositorios "+myrepos.toList().size());
log.info("Detalles de mis repositorios "+myrepos.toList());
*/
GHOrganization unaOrg = github.getOrganization("MIT-FS");
// PagedIterable<GHRepository> repos=unaOrg.listRepositories();
System.out.println("Recupero la organizaci�n "+unaOrg.getId());
System.out.println("Recupero la organizacion "+unaOrg.getId());
GHRepository githubrepo=github.getRepository("hub4j/github-api");
System.out.println("Este repositorio es de "+githubrepo.getOwnerName()+" Y su descripci�n es "+githubrepo.getDescription());
System.out.println("Este repositorio es de "+githubrepo.getOwnerName()+" Y su descripcion es "+githubrepo.getDescription());
GHRepositoryStatistics estadisticas=githubrepo.getStatistics();
log.info("Estadisticas recogidas");

// List<GHProject> proyectos=githubrepo.listProjects().toList();
PagedIterable<GHRepositoryStatistics.ContributorStats> estDes=estadisticas.getContributorStats();
log.info("Desarrolladores recogidos");
List<GHRepositoryStatistics.ContributorStats> listaDesarrolladores=estDes.toList();
System.out.println("N�mero de desarrolladores "+listaDesarrolladores.size());
System.out.println("Numero de desarrolladores "+listaDesarrolladores.size());

i=1;


HashMap <String, GHRepositoryStatistics.ContributorStats> mapaEstadisticasUsuario = new HashMap <String, GHRepositoryStatistics.ContributorStats> ();
for (GHRepositoryStatistics.ContributorStats desarrollador:listaDesarrolladores) {
//System.out.println(i+" Desarrollador "+desarrollador.getAuthor().getName()+" mail "+desarrollador.getAuthor().getEmail()+ " login "+desarrollador.getAuthor().getLogin());
// GHUser usuario=github.getUser(desarrollador.getAuthor().getLogin());
// System.out.println(i+" Desarrollador "+desarrollador.getAuthor().getName()+" mail "+desarrollador.getAuthor().getEmail()+ " login "+desarrollador.getAuthor().getLogin());
// GHUser usuario=github.getUser(desarrollador.getAuthor().getLogin());
mapaEstadisticasUsuario.put(desarrollador.getAuthor().getLogin(), desarrollador);
i++;
}
System.out.println("Datos del usuario rtyley "+mapaEstadisticasUsuario.get("rtyley"));
System.out.println("Semanas "+mapaEstadisticasUsuario.get("rtyley").getWeeks());
// System.out.println("Semanas "+mapaEstadisticasUsuario.get("rtyley").getWeeks());

/*for(GHProject project:proyectos){
System.out.println("Con proyecto "+i+" llamado "+project.getName()+" con id "+project.getId());
Expand Down